-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.common.js
97 lines (94 loc) · 2.37 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const SRC_DIR = path.resolve(__dirname, 'src');
const appDir = path.resolve(__dirname, 'build');
const config = {
entry: './src/main.jsx',
output: {
path: appDir,
filename: 'main.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.html$/,
use: 'file-loader'
},
{
test: /\.jsx?/,
include: SRC_DIR,
loader: 'babel-loader'
},
{
test: /\.scss$/,
use: [
{ loader: 'style-loader' },
{
loader: 'css-loader',
options: {
url: false
}
},
{ loader: 'sass-loader' }
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
inject: false,
template: require('html-webpack-template'),
title: 'Mapping Inequality',
filename: 'index.html',
appMountId: 'app-container',
links: [
'https://fonts.googleapis.com/css?family=Merriweather:300|Lato:400,100,300|Lora:100,400,400i|PT+Sans:400',
'//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0/leaflet.css'
],
scripts: ['https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.core.js'],
meta: [
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
},
{
property: 'og:url',
content: 'https://dsl.richmond.edu/panorama/congress/'
},
{
property: 'og:title',
content: 'Electing the House of Representatives'
},
{
property: 'og:description',
content: 'Maps and visualizations of House elections for nearly two centuries.'
},
{
property: 'og:image',
content: 'https://dsl.richmond.edu/panorama/congress/static/ogimage.png'
},
{
property: 'og:image:width',
content: '1200'
},
{
property: 'og:image:height',
content: '630'
}
]
}),
new ExtractTextPlugin({
filename: '[name].[contenthash].css',
disable: process.env.NODE_ENV === 'development'
})
],
node: {
fs: 'empty'
}
};
module.exports = config;