forked from online-go/online-go.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
90 lines (78 loc) · 2.66 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
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
'use strict';
console.log(process.env.NODE_PATH)
var path = require('path');
let fs = require('fs');
var webpack = require('webpack');
const production = process.env.PRODUCTION ? true : false;
module.exports = {
entry: {
'ogs': './src/main.tsx',
},
resolve: {
modules: [
'src/lib',
'src/lib/goban',
'src/components',
'src/views',
'src',
'node_modules'
],
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"],
},
output: {
path: __dirname + '/dist',
filename: '[name].js'
},
module: {
loaders: [
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
{
test: /\.tsx?$/,
loader: "ts-loader",
exclude: /node_modules/,
}
]
},
performance: {
maxAssetSize: 1024*1024*2.5,
maxEntrypointSize: 1024*1024*2.5,
},
plugins: [
new webpack.BannerPlugin(`Copyright (C) 2012-2017 Online-Go.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.`
)
],
//devtool: 'eval',
devtool: 'source-map',
//devtool: 'cheap-module-source-map',
//devtool: 'cheap-source-map',
// When importing a module whose path matches one of the following, just
// assume a corresponding global variable exists and use that instead.
// This is important because it allows us to avoid bundling all of our
// dependencies, which allows browsers to cache those libraries between builds.
externals: {
"react": "React",
"react-dom": "ReactDOM",
"react-router": "ReactRouter",
"react-datetime": "Datetime",
//"react-autosuggest": "Autosuggest",
"react-redux": "ReactRedux",
"redux": "Redux",
"blueimp-md5": "md5",
//"eventemitter3": "EventEmitter",
"markdown-it": "markdownit",
"moment": "moment",
"d3": "d3",
"es6-promise": "ES6Promise",
"swal": "swal", // can't seem to import anyways
},
};