-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
63 lines (61 loc) · 1.51 KB
/
webpack.config.ts
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
61
62
63
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import HtmlWebpackRootPlugin from 'html-webpack-root-plugin';
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
import WasmPackPlugin from '@wasm-tool/wasm-pack-plugin';
const config: webpack.Configuration = {
mode: 'development',
devtool: 'inline-source-map',
entry: './src/index.tsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[chunkhash:8].js',
chunkFilename: '[name].[chunkhash:8].chunk.js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.glsl', '.txt', '.css', '.rs']
},
module: {
strictExportPresence: true,
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
compilerOptions: {
module: "esnext",
moduleResolution: "node"
}
}
},
{
test: /\.(glsl|txt)$/,
use: {
loader: 'raw-loader'
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
}
]
},
plugins: [
new HtmlWebpackPlugin({
title: 'Vector-8',
meta: {
"viewport": "width=device-width, user-scalable=false"
}
}),
new HtmlWebpackRootPlugin(),
new MonacoWebpackPlugin({
languages: ['javascript', 'typescript']
}),
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, ".")
})
]
};
export default config;