checkout/config/webpack.dev.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

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