ソースを参照

Merge pull request #20389 from mrdoob/rollup

Rollup: Replace addons three.module.js dependency.
Mr.doob 4 年 前
コミット
f93563c95b
1 ファイル変更24 行追加0 行削除
  1. 24 0
      utils/build/rollup.config.js

+ 24 - 0
utils/build/rollup.config.js

@@ -180,6 +180,27 @@ function glconstants() {
 
 
 }
 }
 
 
+function addons() {
+
+	return {
+
+		transform( code, id ) {
+
+			if ( /\/examples\/jsm\//.test( id ) === false ) return;
+
+			code = code.replace( 'build/three.module.js', 'src/Three.js' );
+
+			return {
+				code: code,
+				map: null
+			};
+
+		}
+
+	};
+
+}
+
 function glsl() {
 function glsl() {
 
 
 	return {
 	return {
@@ -306,6 +327,7 @@ export default [
 	{
 	{
 		input: 'src/Three.js',
 		input: 'src/Three.js',
 		plugins: [
 		plugins: [
+			addons(),
 			glconstants(),
 			glconstants(),
 			glsl(),
 			glsl(),
 			babel( {
 			babel( {
@@ -329,6 +351,7 @@ export default [
 	{
 	{
 		input: 'src/Three.js',
 		input: 'src/Three.js',
 		plugins: [
 		plugins: [
+			addons(),
 			glconstants(),
 			glconstants(),
 			glsl(),
 			glsl(),
 			babel( {
 			babel( {
@@ -351,6 +374,7 @@ export default [
 	{
 	{
 		input: 'src/Three.js',
 		input: 'src/Three.js',
 		plugins: [
 		plugins: [
+			addons(),
 			glconstants(),
 			glconstants(),
 			glsl(),
 			glsl(),
 			header()
 			header()