-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
53 lines (45 loc) · 1.04 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
47
48
49
50
51
52
53
const webpack = require('webpack')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const PATHS = {
src: path.join(__dirname, 'src'),
dist: path.join(__dirname, 'dist'),
}
const GH_URL = process.env.GH_URL
const TR_URL = process.env.TR_URL
const GIT_COMMIT_HASH = process.env.GIT_COMMIT_HASH
module.exports = {
entry: {
main: path.join(PATHS.src, 'index.js'),
},
plugins: [
new HtmlWebpackPlugin({
template: PATHS.src + '/index.ejs',
title: 'Docket',
}),
new webpack.DefinePlugin({
GH_URL: JSON.stringify(GH_URL),
TR_URL: JSON.stringify(TR_URL),
GIT_COMMIT_HASH: JSON.stringify(GIT_COMMIT_HASH),
}),
],
resolve: {
extensions: ['.js'],
modules: [PATHS.src, 'node_modules'],
},
module: {
rules: [
{
test: [/\.js$/],
exclude: [/node_modules/, /\.story.js$/, /\.test.js$/],
loader: 'babel-loader',
},
],
},
devServer: {
historyApiFallback: true,
},
output: {
path: PATHS.dist,
},
}