-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
58 lines (53 loc) · 1.23 KB
/
webpack.config.js
File metadata and controls
58 lines (53 loc) · 1.23 KB
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
var path = require('path');
var webpack = require('webpack');
var isProd = (process.env.NODE_ENV === 'production');
const CopyPlugin = require("copy-webpack-plugin");
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
function getPlugins() {
var plugins = [
new webpack.optimize.ModuleConcatenationPlugin(),
new CopyPlugin({
patterns: [
{ from: "./public" },
],
}),
];
return plugins;
}
const config = {
entry: './src/havoc.ts',
devtool: 'inline-source-map',
optimization: {
minimize: isProd
},
output: {
path: path.resolve(__dirname, 'build'),
filename: 'havoc.js',
publicPath: "/build/"
},
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.js']
},
plugins: getPlugins(),
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /\.wav/, loader: 'file-loader' }
]
},
resolve: {
extensions: ['.ts', '.js'],
plugins: [
new TsconfigPathsPlugin({
configFile: 'tsconfig.json',
extensions: ['.ts', '.js']
})
]
}
};
if (isProd) {
console.log('production build');
} else {
console.log('development build');
}
module.exports = config;