2018-08-10 12:49:26 +02:00
|
|
|
// Copyright BigchainDB GmbH and BigchainDB contributors
|
|
|
|
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
|
|
|
// Code is Apache-2.0 and docs are CC-BY-4.0
|
|
|
|
|
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)
|
|
|
|
}
|