-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.config.js
45 lines (42 loc) · 995 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
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const JS_PATH = './src/js/';
const SCSS_PATH = './src/scss/';
let entry = {
main: ['./src/js/main.js', './src/scss/main.scss']
};
module.exports = {
entry: entry,
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'public')
},
module: {
rules: [
{
test: /\.jsx?/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [{
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader" // compiles Sass to CSS
}],
// use style-loader in development
fallback: "style-loader"
})
},
{
test: /\.json$/, // To load the json files
loader: 'json-loader'
}
]
},
plugins: [
new ExtractTextPlugin("[name].css")
]
};