Переделка конфигов webpack для лучшей сборки
This commit is contained in:
@@ -5,10 +5,18 @@ const merge = require("webpack-merge");
|
||||
const baseWpConfig = require("./webpack.base.config");
|
||||
|
||||
baseWpConfig.entry.unshift("webpack-hot-middleware/client");
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
const publicDir = path.resolve(__dirname, '../server/public');
|
||||
const clientDir = path.resolve(__dirname, '../client');
|
||||
|
||||
module.exports = merge(baseWpConfig, {
|
||||
mode: 'none',
|
||||
mode: 'development',
|
||||
devtool: "#inline-source-map",
|
||||
output: {
|
||||
path: `${publicDir}/app`,
|
||||
filename: 'bundle.js'
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
@@ -28,6 +36,10 @@ module.exports = merge(baseWpConfig, {
|
||||
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoEmitOnErrorsPlugin()
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
template: `${clientDir}/index.html.template`,
|
||||
filename: `${publicDir}/index.html`
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user