-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
49 lines (48 loc) · 959 Bytes
/
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
49
function getStyleUse(bundleFilename) {
return [
{
loader: 'file-loader',
options: {
name: bundleFilename,
},
},
{ loader: 'extract-loader' },
{ loader: 'css-loader' },
{
loader: 'sass-loader',
options: {
includePaths: ['./node_modules'],
implementation: require('dart-sass'),
fiber: require('fibers'),
}
},
];
}
module.exports = [
{
entry: './home.scss',
output: {
// This is necessary for webpack to compile, but we never reference this js file.
filename: 'style-bundle-home.js',
},
module: {
rules: [{
test: /home.scss$/,
use: getStyleUse('bundle-home.css')
}]
},
},
{
entry: "./home.js",
output: {
filename: "bundle-home.js"
},
module: {
loaders: [{
test: /home.js$/,
loader: 'babel-loader',
query: {presets: ['env']}
}]
},
}
];