-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdev.config.js
48 lines (46 loc) · 1.5 KB
/
dev.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
// This file is used to configure Webpack to run the self-updating dev frontend server.
const {merge} = require('webpack-merge');
const baseConfig = require('./common.config.js');
const path = require('path');
module.exports = merge(baseConfig, {
devServer: {
historyApiFallback: {
rewrites: [ // these force Webpack to only use the first parts of the URL, so it can retrieve the correct index
{from: /^\/admin\//, to: '/admin'},
{from: /^\/main\//, to: '/main'},
{from: /^\/$/, to: '/main'}
]
},
static: path.join(__dirname, '../assets')
},
module: {
rules: [
{
test: /\.s?[ac]ss$/i,
use: [
{
loader: 'style-loader',
options: {
// injectType: 'singletonStyleTag'
}
},
// Translates CSS into CommonJS
{
loader: 'css-loader',
options: {
sourceMap: true
}
},
// Compiles Sass to CSS
{
loader: 'sass-loader',
options: {
sourceMap: true
}
}
]
}
]
},
mode: 'development'
});