-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
38 lines (35 loc) · 847 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
38 lines (35 loc) · 847 Bytes
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
'use strict';
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/background.ts`
],
output: {
publicPath: '/',
path: DIST_PATH,
filename: 'bundle.min.js',
clean: true
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
module: {
rules: [
{ test: /\.[jt]sx?$/, loader: 'ts-loader', exclude: /node_modules/, }
]
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'resources/90.png', to: `${DIST_PATH}/resources` },
{ from: 'resources/128.png', to: `${DIST_PATH}/resources` }
]
})
]
};