forked from repalash/xatlas-three
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
57 lines (55 loc) · 1.36 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import path from 'path';
import url from 'url';
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default (env)=>({
mode: 'development',
devtool: 'source-map',
entry: env.no_worker ? './src/unwrapperJS.ts' : './src/unwrapperWorker.ts',
experiments: {
outputModule: true
},
devServer: {
hot: false,
port: 6237,
static: {
serveIndex: true,
directory: __dirname
},
devMiddleware: {
writeToDisk: true,
},
open: ['http://localhost:6237/public/uvs-debug.html'],
client: false,
},
output: {
filename: !!env.no_worker ? 'index-no-worker.js' : 'index.js',
module: true,
path: path.resolve(__dirname, 'public/build'),
publicPath: '/public/build/',
library: {
type: "module"
},
clean: true
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
},
]
},
watchOptions: {
ignored: /node_modules/
}
})