2018-11-26 15:55:09 +01:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const PRODUCTION = process.env.NODE_ENV === 'production'
|
|
|
|
|
|
|
|
const common = require('./webpack.common.js')
|
|
|
|
|
|
|
|
const { outputs } = require('./webpack.parts.js')
|
|
|
|
|
|
|
|
// '[libraryTarget]': [file extension]
|
|
|
|
const OUTPUT_MAPPING = {
|
2019-06-20 00:20:09 +02:00
|
|
|
amd: 'amd',
|
|
|
|
commonjs: 'cjs',
|
|
|
|
commonjs2: 'cjs2',
|
|
|
|
umd: 'umd',
|
|
|
|
window: 'window'
|
2018-11-26 15:55:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const OVERRIDES = {
|
|
|
|
// optimization: {
|
|
|
|
// minimize: false
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
if (PRODUCTION) {
|
|
|
|
module.exports = outputs(common, 'production', OUTPUT_MAPPING, OVERRIDES)
|
|
|
|
} else {
|
|
|
|
module.exports = outputs(common, 'development', OUTPUT_MAPPING, OVERRIDES)
|
|
|
|
}
|