-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.cjs
103 lines (101 loc) · 2.28 KB
/
webpack.config.cjs
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
// context: __dirname,
entry: {
bundle: './src/main.js',
worker: './src/worker.js',
// tests: './src/gs/tests.js',
test: ['./test/util/Cryptor.test.js', './test/util/Deflater.test.js'], // './test/webrtc/YadorigiFileProsessor.test.js', './test/webrtc/YadorigiSignalingAdupter.test.js'],
},
// [
// './src/main.js','./src/worker.js', './index.css'
// ],mymodernmet.com/studio-ghibli-virtual-backgrounds/
output: {
// 出力するファイル名
// filename: '[name].js',
filename: '[name].js',
// 出力先のパス
// path: __dirname + '/public',
path: path.join(__dirname, 'public'),
//publicPath: __dirname + "/dest/js",
webassemblyModuleFilename: '[modulehash].wasm',
publicPath: '/',
globalObject: 'this',
},
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: 'style-loader!css-loader?importLoaders=1&camelCase',
},
],
},
{
test: /\.js$/,
exclude: [/node_modules/, '/src/gs/'],
},
{
test: /\.wasm$/,
type: 'webassembly/experimental',
},
{
test: /test\.js$/,
exclude: [/node_modules/, '/src/gs/'],
},
],
},
devServer: {
port: 8085,
hot: 'only',
open: ['/index.html'],
watchFiles: {
paths: ['src/**/*.js', 'dist/**/*'],
options: {
usePolling: false,
},
},
// contentBase: path.join(__dirname, 'dist'),
// publicPath: '/',
// static: {
// directory: path.join(__dirname, 'dist'),
// serveIndex: true,
// watch: false,
// },
client: {
logging: 'info',
// Can be used only for `errors`/`warnings`
//
// overlay: {
// errors: true,
// warnings: true,
// }
overlay: true,
progress: true,
},
},
plugins: [
new webpack.LoaderOptionsPlugin({
// test: /\.xxx$/, may apply this only for some modules
options: {
html: './index.html',
},
}),
//new webpack.optimize.UglifyJsPlugin(),
//new webpack.optimize.AggressiveMergingPlugin(),
new HtmlWebpackPlugin({
// http://localhost:8085/testmocha.html
filename: 'testmocha.html',
inject: 'body',
chunks: ['test'],
}),
],
devtool: 'source-map',
resolve: {
extensions: ['.js'],
},
};