Skip to content

Commit 05862e6

Browse files
authored
Merge pull request #599 from loveTsong/feature/frontend-webpack-module-config
[frontend] refactor: convert webpack output from UMD to ES module
2 parents 5523494 + 68412eb commit 05862e6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

frontend/webpack.common.single.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ module.exports = {
2020
path: path.resolve(rootPath, 'build'),
2121
filename: '[name].js',
2222
chunkFilename: '[name].js',
23-
library: 'appengine',
24-
libraryTarget: 'umd',
23+
library: {
24+
type: 'module',
25+
},
2526
assetModuleFilename: 'assets/images/[name][ext]',
2627
},
28+
experiments: {
29+
outputModule: true
30+
},
31+
externalsType: 'module',
2732
module: {
2833
rules: [{
2934
test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/i,
@@ -145,6 +150,7 @@ module.exports = {
145150
template: path.resolve(rootPath, 'src/index.html'),
146151
publicPath: '',
147152
chunks: ['main'],
153+
scriptLoading: 'module'
148154
}),
149155

150156
new CopyWebpackPlugin({

0 commit comments

Comments
 (0)