-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (45 loc) · 1.12 KB
/
webpack.config.js
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
const path = require('path');
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
// If your entry-point is at "src/index.js" and
// your output is in "/dist", you can ommit
// these parts of the config
module: {
rules: [{
test: /\.html$/,
exclude: /node_modules/,
loader: 'file-loader?name=[name].[ext]'
},
{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
// This is what you need in your own work
loader: "elm-webpack-loader",
// loader: '../index.js',
options: {
debug: !isProd,
optimize: isProd
// warn: true
}
},
{
test: /\.less$/,
use: [{
loader: 'style-loader' // creates style nodes from JS strings
}, {
loader: 'css-loader' // translates CSS into CommonJS
}, {
loader: 'less-loader' // compiles Less to CSS
}]
}
]
},
devServer: {
inline: true,
stats: 'errors-only',
contentBase: path.resolve('src'),
historyApiFallback: {
index: 'index.html'
}
}
};