2017-04-26 15:58:19 +02:00
|
|
|
/* eslint-disable strict, no-console, object-shorthand */
|
|
|
|
|
2017-06-12 16:57:29 +02:00
|
|
|
'use strict'
|
2017-04-26 15:58:19 +02:00
|
|
|
|
2017-06-12 16:57:29 +02:00
|
|
|
const PRODUCTION = process.env.NODE_ENV === 'production'
|
2017-04-26 15:58:19 +02:00
|
|
|
|
2018-07-17 08:51:41 +02:00
|
|
|
const common = require('./webpack.common.js')
|
2017-06-21 17:39:19 +02:00
|
|
|
|
2018-07-17 08:51:41 +02:00
|
|
|
const { outputs } = require('./webpack.parts.js')
|
2017-04-26 15:58:19 +02:00
|
|
|
|
2018-07-17 08:51:41 +02:00
|
|
|
// '[libraryTarget]': [file extension]
|
|
|
|
const OUTPUT_MAPPING = {
|
|
|
|
'amd': 'amd',
|
|
|
|
'commonjs': 'cjs',
|
|
|
|
'commonjs2': 'cjs2',
|
|
|
|
'umd': 'umd',
|
|
|
|
'window': 'window',
|
2017-04-26 15:58:19 +02:00
|
|
|
}
|
|
|
|
|
2018-07-17 08:51:41 +02:00
|
|
|
const OVERRIDES = {
|
|
|
|
// optimization: {
|
|
|
|
// minimize: false
|
|
|
|
// }
|
2017-06-12 16:57:29 +02:00
|
|
|
}
|
2017-04-26 15:58:19 +02:00
|
|
|
|
2018-07-17 08:51:41 +02:00
|
|
|
if (PRODUCTION) {
|
|
|
|
module.exports = outputs(common, 'production', OUTPUT_MAPPING, OVERRIDES)
|
|
|
|
} else {
|
|
|
|
module.exports = outputs(common, 'development', OUTPUT_MAPPING, OVERRIDES)
|
|
|
|
}
|