-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (42 loc) · 1.1 KB
/
webpack.config.js
File metadata and controls
44 lines (42 loc) · 1.1 KB
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
// TODO mini-css-extra-plugin to compile dist/index.css file separate from dist/bundle.js
const webpack = require('webpack');
const config = {
entry: __dirname + '/javascripts/index.jsx',
output: {
path: __dirname + '/dist',
filename: 'bundle.js',
// filename: 'bundle.[contenthash].js',
},
resolve: {
extensions: ['.js', '.jsx', '.css', '.scss']
},
module: {
rules: [
{
test: /\.jsx?/,
exclude: /node_modules/,
use: 'babel-loader'
},
{
test: /\.(s*)css$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: 'file-loader'
}
]
},
devServer: {
contentBase: __dirname,
publicPath: '/dist/',
historyApiFallback: {
index: 'index.html' // Serve index.html for all URLs
}
},
};
module.exports = config;