-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
42 lines (38 loc) · 1.01 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
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const fs = require('fs');
var config = {
entry: './site/public/ts/Main.ts',
output: {
filename: 'Bundle.js',
path: path.resolve(__dirname, 'build')
},
plugins: [
new CopyWebpackPlugin([
{ from: 'site/public/index.php', to: 'index.php' },
{ from: 'site/app/', to: 'app/' },
{ from: 'site/data/', to: 'data/' },
{ from: 'site/public/css/', to: 'css/' },
{ from: 'site/public/img/', to: 'img/' }
])
],
devtool: 'source-map',
module: {
rules: [ {
test: /\.tsx?$/,
exclude: /(node_modules)/,
use: {
loader: 'ts-loader'
}
} ]
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
}
};
module.exports = (env, argv) => {
if (argv.mode === 'development') {
// do some different stuff maybe
}
return config;
};