|
|
@ -1,13 +1,13 @@ |
|
|
|
var path = require('path'); |
|
|
|
var webpack = require('webpack'); |
|
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin'); |
|
|
|
const config = require('./config.js'); |
|
|
|
// const config = require('./config.js');
|
|
|
|
|
|
|
|
const PATHS = { |
|
|
|
app: path.join(__dirname, 'client/src'), |
|
|
|
build: path.join(__dirname, 'client/build') |
|
|
|
}; |
|
|
|
console.log(config); |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
mode: "production", |
|
|
|
entry: { |
|
|
@ -32,16 +32,16 @@ module.exports = { |
|
|
|
filename: '../index.html', |
|
|
|
template: './client/index.ejs' |
|
|
|
}), |
|
|
|
new webpack.DefinePlugin({ |
|
|
|
'process.env.NODE_ENV': JSON.stringify('development'), |
|
|
|
...(() => { |
|
|
|
let nextParams = {} |
|
|
|
for (let k in config.frontParams) { |
|
|
|
nextParams[k] = JSON.stringify(config.frontParams[k]) |
|
|
|
} |
|
|
|
return nextParams |
|
|
|
})() |
|
|
|
}), |
|
|
|
// new webpack.DefinePlugin({
|
|
|
|
// 'process.env.NODE_ENV': JSON.stringify('development'),
|
|
|
|
// ...(() => {
|
|
|
|
// let nextParams = {}
|
|
|
|
// for (let k in config.frontParams) {
|
|
|
|
// nextParams[k] = JSON.stringify(config.frontParams[k])
|
|
|
|
// }
|
|
|
|
// return nextParams
|
|
|
|
// })()
|
|
|
|
// }),
|
|
|
|
], |
|
|
|
optimization: { |
|
|
|
splitChunks: { |
|
|
|