Browse Source

Replace the `three_module_js` local variable name with `THREE`

Garrett Johnson 6 years ago
parent
commit
6785048795
1 changed files with 16 additions and 1 deletions
  1. 16 1
      rollup-examples.config.js

+ 16 - 1
rollup-examples.config.js

@@ -17,6 +17,20 @@ function createOutput( file ) {
 		treeshake: false,
 		treeshake: false,
 		external: p => p !== inputPath,
 		external: p => p !== inputPath,
 
 
+		plugins: [{
+
+			generateBundle: function(options, bundle) {
+
+				for ( var key in bundle ) {
+
+					bundle[ key ].code = bundle[ key ].code.replace( /three_module_js/g, 'THREE' );
+
+				}
+
+			}
+
+		}],
+
 		output: {
 		output: {
 
 
 			format: 'umd',
 			format: 'umd',
@@ -30,7 +44,8 @@ function createOutput( file ) {
 			banner:
 			banner:
 				'/**\n' +
 				'/**\n' +
 				` * Generated from '${ path.relative( '.', inputPath.replace( /\\/, '/' ) ) }'\n` +
 				` * Generated from '${ path.relative( '.', inputPath.replace( /\\/, '/' ) ) }'\n` +
-				' */\n'
+				' */\n',
+			esModule: false
 
 
 		}
 		}