forked from PaddlePaddle/Paddle.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
52 lines (51 loc) · 1.3 KB
/
webpack.dev.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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
entry: {
index: './index.ts'
},
devtool: 'inline-source-map',
devServer: {
port: 8866,
host: '0.0.0.0'
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['index'],
template: './index.html'
})
],
resolve: {
// Add ".ts" and ".tsx" as resolvable extensions.
extensions: ['.ts', '.js'],
alias: {
'@paddlejs/paddlejs-core': path.resolve(__dirname, '../../paddlejs-core/src/'),
'@paddlejs/paddlejs-backend-webgl': path.resolve(__dirname, '../../paddlejs-backend-webgl/src/')
}
},
module: {
rules: [
// Handle our workers
{
test: /worker\.ts$/,
loader: 'worker-loader',
exclude: /node_modules/
},
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/
}
]
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
globalObject: 'this'
},
node: {
fs: 'empty'
}
};