-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.config.js
45 lines (44 loc) · 938 Bytes
/
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
45
const path = require('path');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = [{
entry: './src/App.ts',
output: {
filename: './js/main.js',
path: path.resolve(__dirname, 'build')
},
performance: {
hints: false
},
devtool: 'inline-source-map',
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html',
minify: false
}),
new CopyPlugin({
patterns: [
{from: './src/textures', to: path.resolve(__dirname, 'build/textures')}
]
}),
],
module: {
rules: [
{
test: /\.ts|.tsx$/,
loader: 'ts-loader',
options: {configFile: 'tsconfig.json'},
exclude: /node_modules/
}, {
test: /\.(frag|vert)$/i,
use: 'raw-loader'
}
]
},
resolve: {
extensions: ['.ts', '.js']
}
}];