-
Notifications
You must be signed in to change notification settings - Fork 52
/
webpack.common.js
59 lines (56 loc) · 1.41 KB
/
webpack.common.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
50
51
52
53
54
55
56
57
58
59
const path = require("path")
const output_dir = 'static/bundles'
module.exports = {
entry: {
main: ['babel-polyfill', './js/main'],
common_components: ['./js/common-components'],
fyl: ['./js/find-your-legislator'],
state_map: ['./js/state-map'],
district_map: ['./js/legislator-map'],
dashboards: ['./js/dashboards'],
people_admin: ['./js/admin/people'],
},
output: {
path: path.resolve(output_dir),
publicPath: "/static/",
filename: "[name].js",
chunkFilename: "[id]-[chunkhash].js",
},
devServer: {
writeToDisk: true
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query: { plugins: ['transform-runtime'] }
},
{
test: /\.scss$/,
use: [
{ loader: "style-loader", options: {sourceMap: true} },
{ loader: "css-loader" },
{ loader: "sass-loader", options: {
//includePaths: [path.resolve(__dirname, 'node_modules')],
sourceMap: true
} },
]
},
{ test: /\.css$/, use: [{loader: "css-loader"}] },
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}
]
}
],
},
}