forked from reiinakano/arbitrary-image-stylization-tfjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
63 lines (60 loc) · 1.67 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
58
59
60
61
62
63
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
let isDevelopment = process.env.NODE_ENV === 'production' ? false : true;
module.exports = {
mode: !isDevelopment ? 'production' : 'development',
devtool: 'inline-source-map',
entry: {
main: __dirname + '/src/main.js',
data_worker: __dirname + '/src/data/worker.js',
dnn_worker: __dirname + '/src/dnn/worker.js'
},
output: {
path: path.resolve(__dirname, 'dist')
},
plugins: [
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
template: __dirname + '/public/index.html'
}),
new CopyPlugin([
{from: __dirname + '/saved_models', to: __dirname + '/dist/saved_models'},
{from: __dirname + '/images', to: __dirname + '/dist/images'}
])
],
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader'
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: [ '.tsx', '.ts', '.js', '.jsx']
},
node: {
fs: "empty"
}
};