Browse Source

Build examples: Make the libs replace more generalized (#21882)

Marco Fugaro 4 years ago
parent
commit
db106b502a
1 changed files with 1 additions and 6 deletions
  1. 1 6
      utils/build/rollup.examples.config.js

+ 1 - 6
utils/build/rollup.examples.config.js

@@ -110,12 +110,7 @@ function unmodularize() {
 
 
 			// Remove library imports that are exposed as
 			// Remove library imports that are exposed as
 			// global variables in the non-module world
 			// global variables in the non-module world
-			code = code.replace( 'import * as fflate from \'../libs/fflate.module.js\';', '' );
-			code = code.replace( 'import { MMDParser } from \'../libs/mmdparser.module.js\';', '' );
-			code = code.replace( 'import { potpack } from \'../libs/potpack.module.js\';', '' );
-			code = code.replace( 'import { opentype } from \'../libs/opentype.module.min.js\';', '' );
-			code = code.replace( 'import chevrotain from \'../libs/chevrotain.module.min.js\';', '' );
-			code = code.replace( 'import { ZSTDDecoder } from \'../libs/zstddec.module.js\';', '' );
+			code = code.replace( /import (.*) from '(.*)\/libs\/(.*)';/g, '' );
 
 
 			// remove newline at the start of file
 			// remove newline at the start of file
 			code = code.trimStart();
 			code = code.trimStart();