-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (41 loc) · 1.03 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
'use strict';
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const path = require('path');
const CONTEXT_PATH = path.resolve(__dirname);
const DIST_PATH = `${CONTEXT_PATH}/dist/compiled/`;
const SRC_PATH = `${CONTEXT_PATH}/src`;
module.exports = {
mode: 'production',
context: CONTEXT_PATH,
entry: [
`${SRC_PATH}/ts/main.tsx`
],
output: {
publicPath: '/',
path: DIST_PATH,
filename: 'bundle.min.js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
module: {
rules: [
{ test: /\.tsx?$/, loader: 'awesome-typescript-loader' }
]
},
optimization: {
// minimizer: [new UglifyJsPlugin()],
minimize: false
},
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
patterns: [
{ from: 'resources/90.png', to: `${DIST_PATH}/resources` },
{ from: 'resources/128.png', to: `${DIST_PATH}/resources` }
]
})
]
};