-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.mjs
More file actions
60 lines (58 loc) · 1.13 KB
/
webpack.config.mjs
File metadata and controls
60 lines (58 loc) · 1.13 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import CopyPlugin from 'copy-webpack-plugin';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
export default {
mode: 'development',
entry: './main.ts',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
plugins: [
new CopyPlugin({
patterns: ['index.html']
})
],
experiments: {
asyncWebAssembly: true,
topLevelAwait: true
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.m?js$/,
resolve: {
fullySpecified: false
}
},
// これ何?
{
test: /\.(vert|frag)$/,
type: 'asset/source',
}
]
},
resolve: {
extensions: ['.ts', '.js']
},
devServer: {
static: './dist',
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin'
},
// circular dependendy を非表示
client: {
overlay: {
warnings: false,
errors: true
}
}
},
};