-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathwebpack.common.js
38 lines (35 loc) · 1.09 KB
/
webpack.common.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
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
plugins: [
// Automatically creat an index.html with the right bundle name and references to our javascript.
new HtmlWebpackPlugin({
template: 'html/index.html'
}),
// Copy game assets from our static directory, to the webpack output
new CopyPlugin({
patterns: [
{from: 'static', to: 'static'}
]
}),
],
// Entrypoint for our game
entry: './game.ts',
module: {
rules: [
{
// Load our GLSL shaders in as text
test: /\.(glsl|vs|fs|vert|frag)$/, exclude: /node_modules/, use: ['raw-loader']
},
{
// Process our typescript and use ts-loader to transpile it to Javascript
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
}
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
}