mon-entreprise/site/webpack.dev.js

38 lines
804 B
JavaScript

/* eslint-env node */
const { map } = require('ramda')
const webpack = require('webpack')
const {
HTMLPlugins,
styleLoader,
commonLoaders,
default: common,
} = require('./webpack.common')
module.exports = {
...common,
node: {
// This seems necessary to prevent a "Module not found: 'fs'" error when
// launching mocha-webpack:
fs: 'empty',
},
module: {
rules: [...commonLoaders(), styleLoader('style-loader')],
},
watchOptions: {
aggregateTimeout: 600,
},
mode: 'development',
devtool: 'eval-source-map',
entry: map((entry) => ['webpack-hot-middleware/client', entry], common.entry),
plugins: [
...common.plugins,
...HTMLPlugins(),
new webpack.EnvironmentPlugin({
NODE_ENV: 'development',
REDUX_TRACE: false,
}),
new webpack.HotModuleReplacementPlugin(),
],
}