2020-08-25 10:22:29 +00:00
|
|
|
const { merge } = require('webpack-merge');
|
2017-03-31 18:21:41 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const commonConfig = require('./common.js');
|
2021-06-27 15:34:25 +00:00
|
|
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
2017-03-31 18:21:41 +00:00
|
|
|
|
2020-11-11 08:48:04 +00:00
|
|
|
module.exports = merge(commonConfig, {
|
|
|
|
devtool: 'eval-source-map',
|
|
|
|
output: {
|
|
|
|
filename: '[name].dev.js',
|
|
|
|
},
|
|
|
|
mode: 'development',
|
|
|
|
devServer: {
|
|
|
|
hot: true,
|
|
|
|
// enable HMR on the server
|
|
|
|
contentBase: './web',
|
|
|
|
// match the output path
|
|
|
|
},
|
|
|
|
plugins: [
|
2021-06-27 15:34:25 +00:00
|
|
|
new ESLintPlugin(),
|
2020-11-11 08:48:04 +00:00
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
|
|
],
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /(node_modules)/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['@babel/preset-env'],
|
|
|
|
},
|
2017-03-31 18:21:41 +00:00
|
|
|
},
|
2020-11-11 08:48:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(s)?css$/,
|
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
2017-03-31 18:21:41 +00:00
|
|
|
options: {
|
2020-11-11 08:48:04 +00:00
|
|
|
importLoaders: 1,
|
2017-06-20 05:14:04 +00:00
|
|
|
},
|
|
|
|
},
|
2020-11-11 08:48:04 +00:00
|
|
|
{
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
options: {
|
|
|
|
postcssOptions: {
|
|
|
|
plugins: ['autoprefixer'],
|
2020-08-25 10:22:29 +00:00
|
|
|
},
|
|
|
|
},
|
2020-11-11 08:48:04 +00:00
|
|
|
},
|
|
|
|
'sass-loader',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(jpg|png|gif|svg|ico|eot|ttf|woff|woff2)$/,
|
|
|
|
use: 'url-loader',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|