forked from philschatz/gh-board
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
46 lines (44 loc) · 1.46 KB
/
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
const path = require('path');
const webpack = require('webpack');
const isBuild = process.env['NODE_ENV'] === 'production';
module.exports = {
entry: [
'./style/index.js',
'./src/index.js'
].concat(isBuild ? [] : [
'webpack-dev-server/client?http://0.0.0.0:8080'
]),
output: {
path: __dirname + '/dist',
publicPath: isBuild ? './dist/' : '/dist/', // gh-pages needs this to have a '.' for bundles
filename: 'bundle.js'
},
context: path.resolve(__dirname),
devtool: 'source-map',
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: [/node_modules/, /octokat\.js/],
query: {
presets: ['react', 'es2017-node7']
}
},
{ test: /\.json$/, loader: 'json-loader'},
{ test: /\.less$/, loader: ['style-loader', 'css-loader', 'less-loader'] },
{ test: /\.(png|jpg|svg)/, loader: 'file-loader?name=[name].[ext]'},
{ test: /\.(woff|woff2|eot|ttf)/, loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]' }
]
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
alias: {
xmlhttprequest: path.join(__dirname, '/src/hacks/xmlhttprequest-filler.js'),
fs: path.join(__dirname, '/src/hacks/mermaid-stubs.js'),
proxyquire: path.join(__dirname, '/src/hacks/mermaid-stubs.js'),
rewire: path.join(__dirname, '/src/hacks/mermaid-stubs.js'),
'mock-browser': path.join(__dirname, '/src/hacks/mermaid-stubs.js')
}
}
};