@@ -12,7 +12,10 @@ const cwd = process.cwd(),
1212 buildTarget = requireJson ( path . resolve ( neoPath , 'buildScripts/webpack/development/buildTarget.json' ) ) ,
1313 filenameConfig = requireJson ( path . resolve ( neoPath , 'buildScripts/webpack/json/build.json' ) ) ,
1414 entry = { main : path . resolve ( neoPath , filenameConfig . mainInput ) } ,
15+ copyFile = path . resolve ( neoPath , 'buildScripts/copyFile.mjs' ) ,
1516 copyFolder = path . resolve ( neoPath , 'buildScripts/copyFolder.mjs' ) ,
17+ defConfigFrom = path . resolve ( neoPath , 'src/DefaultConfig.mjs' ) ,
18+ defConfigTo = path . resolve ( cwd , buildTarget . folder , 'DefaultConfig.mjs' ) ,
1619 faFrom = path . resolve ( cwd , 'node_modules/@fortawesome/fontawesome-free' ) ,
1720 faTo = path . resolve ( cwd , buildTarget . folder , 'resources/fontawesome-free' ) ,
1821 nodeCmd = os . platform ( ) . startsWith ( 'win' ) ? 'node.exe' : 'node' ,
@@ -42,6 +45,16 @@ export default {
4245 entry,
4346 target : 'web' ,
4447
48+ experiments : {
49+ outputModule : true
50+ } ,
51+
52+ externals : {
53+ './DefaultConfig.mjs' : './DefaultConfig.mjs'
54+ } ,
55+
56+ externalsType : 'module' ,
57+
4558 plugins : [
4659 // Only for the non workspace based build scope, we have to ignore workspace related addons.
4760 // This might be a fit for webpack.ContextExclusionPlugin, but I did not get it working.
@@ -55,15 +68,19 @@ export default {
5568 }
5669 } ) ,
5770 new WebpackHookPlugin ( {
58- onBuildEnd : [ `${ nodeCmd } ${ copyFolder } -s ${ faFrom } -t ${ faTo } ` ]
71+ onBuildEnd : [
72+ `${ nodeCmd } ${ copyFolder } -s ${ faFrom } -t ${ faTo } ` ,
73+ `${ nodeCmd } ${ copyFile } -s ${ defConfigFrom } -t ${ defConfigTo } `
74+ ]
5975 } ) ,
6076 ...plugins
6177 ] ,
6278
6379 output : {
6480 chunkFilename : 'chunks/main/[id].js' ,
6581 filename : filenameConfig . mainOutput ,
82+ library : { type : 'module' } ,
6683 path : path . resolve ( cwd , buildTarget . folder ) ,
67- publicPath : ''
84+ publicPath : 'auto '
6885 }
6986} ;
0 commit comments