46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
const path = require("path");
|
|
const webpack = require("webpack");
|
|
|
|
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: 'development',
|
|
devtool: "#inline-source-map",
|
|
output: {
|
|
path: `${publicDir}/app`,
|
|
filename: 'bundle.js'
|
|
},
|
|
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: "vue-loader"
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
'vue-style-loader',
|
|
'css-loader'
|
|
]
|
|
},
|
|
]
|
|
},
|
|
|
|
plugins: [
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
|
new HtmlWebpackPlugin({
|
|
template: `${clientDir}/index.html.template`,
|
|
filename: `${publicDir}/index.html`
|
|
})
|
|
]
|
|
});
|