/* eslint-disable import/no-extraneous-dependencies */ const path = require('path'); const webpack = require('webpack'); const merge = require('webpack-merge'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const baseConfig = require('./webpack.base'); const ROOT = path.resolve(__dirname, '..', '..'); module.exports = merge(baseConfig, { entry: ['webpack-hot-middleware/client'], devtool: '#eval-source-map', module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', options: { loaders: { sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax', }, }, }, ], }, plugins: [ // http://vue-loader.vuejs.org/en/workflow/production.html new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"development"', }, }), // generate dist index.html with correct asset hash for caching. // you can customize output by editing /index.html // see https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ filename: path.join(ROOT, 'client', 'index.html'), template: path.join(ROOT, 'src', 'index.html'), inject: true, // necessary to consistently work with multiple chunks via CommonsChunkPlugin chunksSortMode: 'dependency', }), new webpack.HotModuleReplacementPlugin(), ], });