-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.production.js
76 lines (75 loc) · 2.25 KB
/
webpack.config.production.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
const path = require('path');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin');
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
mode: 'production',
entry: {
'app': './src/App.ts',
},
target: 'web',
output: {
path: path.resolve(__dirname, 'dist.production/'),
filename: 'main.min.js'
},
watchOptions: {
ignored: '**/node_modules',
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.jsx']
},
externals: {
"pixi.js": "PIXI",
},
optimization: {
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
output: {
comments: false,
},
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log', 'console.info'],
}
},
}),
],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
plugins: [
/* new CopyWebpackPlugin({
patterns: [
// {from: 'assets', to: 'assets'},
]
}),*/
/*new HtmlWebpackPlugin({
template: 'template/index.html',
hash: true,
inject: false,
featureFlags: {
sentry: true,
},
templateData: {
title: 'Sudoku Rush',
gameVersion: process.env.GAME_VERSION || '1.123',
apiURL: process.env.TRN_API_URL || 'https://ownplay-trinity-development.ue.r.appspot.com',
jailRedirectTarget: process.env.TRN_JAIL_REDIRECT_TARGET || 'x-web-search://duckduckgo?\\affirmatively site:cityversetycoon.com',
gTag: 'G-CZ98RDNT61',
tagManager: 'GTM-W58NXWSR',
facebookPixel: '815457113447548',
bundle: 'app.js?' + ( process.env.BUILD_ID || new Date().getTime())
},
}),*/
]
};