Skip to content

Commit

Permalink
build(webpack): fix lib name and externals config
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Aug 22, 2019
1 parent 02945d9 commit a242277
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const path = require('path')

// preset default output object
const output = {
library: 'EcomPassportClient',
library: 'EcomPassport',
libraryTarget: 'umd',
libraryExport: 'default',
path: path.resolve(__dirname, 'dist'),
filename: 'ecom-passport-client.min.js',
filename: 'ecom-passport.min.js',
globalObject: 'this'
}

Expand All @@ -21,7 +21,7 @@ const config = {
devServer: {
contentBase: path.resolve(__dirname, 'test'),
compress: true,
port: 9022,
port: 9103,
open: true
},
module: {
Expand All @@ -37,7 +37,7 @@ const config = {
colors: true
},
devtool: 'source-map',
externals: devMode ? '' : /^(@babel\/runtime|core-js|@ecomplus\/(utils|client)|lodash)/
externals: devMode ? '' : /^[^./].*$/
}

module.exports = devMode
Expand All @@ -53,6 +53,11 @@ module.exports = devMode
filename: output.filename.replace('.min.js', '.root.min.js')
},
externals: {
eventemitter3: {
commonjs: 'eventemitter3',
commonjs2: 'eventemitter3',
root: 'EventEmitter'
},
'@ecomplus/utils': {
commonjs: '@ecomplus/utils',
commonjs2: '@ecomplus/utils',
Expand All @@ -65,4 +70,4 @@ module.exports = devMode
}
}
}
]
]

0 comments on commit a242277

Please sign in to comment.