forked from NDLANO/ndla-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
48 lines (38 loc) · 987 Bytes
/
Copy pathwebpack.config.dev.js
File metadata and controls
48 lines (38 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* DEVELOPMENT WEBPACK CONFIGURATION
*/
const webpack = require('webpack');
const plugins = [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
];
module.exports = require('./webpack.config.base')({
entry: {
// Add hot reloading in development
main: ['webpack-hot-middleware/client?reload=true&quiet=true'],
// Inject styles for embed development.
embed: ['./style/index.css'],
},
// Don't use hashes in dev mode for better performance
output: {
filename: '[name].js',
},
vendorFilename: '[name].js',
babelPresetTargets: {
chrome: 56,
firefox: 52,
safari: 10,
},
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader', 'postcss-loader'],
},
],
// Add development plugins
plugins,
// Load files without hash in development
fileLoader: 'file-loader?name=[name].[ext]',
// Emit a source map for easier debugging
devtool: 'cheap-module-source-map',
});