2017-05-02 14:04:52 +00:00
|
|
|
const path = require('path');
|
|
|
|
const WriteFilePlugin = require('write-file-webpack-plugin');
|
|
|
|
const merge = require('webpack-merge');
|
2018-02-16 14:37:17 +00:00
|
|
|
const checkoutConfig = require('./checkout-config');
|
|
|
|
const initializerConfig = require('./initializer-config');
|
2018-02-15 11:16:12 +00:00
|
|
|
const prepareOutputConfig = require('./prepare-output-config');
|
2018-07-31 16:53:53 +00:00
|
|
|
const samsungPayConfig = require('./samsung-pay-config');
|
2019-01-29 16:54:37 +00:00
|
|
|
const commonConfig = require('./common-config');
|
2017-05-02 14:04:52 +00:00
|
|
|
|
2018-02-15 11:16:12 +00:00
|
|
|
const commonDevConfig = {
|
2017-05-29 11:15:03 +00:00
|
|
|
devtool: 'source-map',
|
2017-05-02 14:04:52 +00:00
|
|
|
plugins: [
|
2017-12-25 11:20:48 +00:00
|
|
|
new WriteFilePlugin({
|
|
|
|
log: false
|
|
|
|
})
|
2017-05-02 14:04:52 +00:00
|
|
|
],
|
|
|
|
devServer: {
|
|
|
|
contentBase: path.join(__dirname, '../dist'),
|
2017-08-14 12:03:44 +00:00
|
|
|
compress: true,
|
2018-02-15 11:16:12 +00:00
|
|
|
disableHostCheck: false,
|
|
|
|
stats: 'minimal'
|
2017-05-02 14:04:52 +00:00
|
|
|
}
|
2018-02-15 11:16:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const baseOutput = 'dist';
|
|
|
|
|
2019-01-29 16:54:37 +00:00
|
|
|
const prepareModule = (env, baseConfig, outputPath) =>
|
|
|
|
merge(baseConfig, commonConfig(env), prepareOutputConfig(outputPath), commonDevConfig);
|
2018-02-15 11:16:12 +00:00
|
|
|
|
2019-01-29 16:54:37 +00:00
|
|
|
module.exports = (env, { mode }) => [
|
|
|
|
prepareModule(mode, checkoutConfig, `${baseOutput}/v1`),
|
|
|
|
prepareModule(mode, samsungPayConfig, `${baseOutput}/v1`),
|
|
|
|
prepareModule(mode, initializerConfig, baseOutput)
|
2018-02-15 11:16:12 +00:00
|
|
|
];
|