-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.dev.js
86 lines (73 loc) · 2.11 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
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
const Webpack = require('webpack'),
// TerserPlugin = require('terser-webpack-plugin'),
path = require('path');
const webpackConfig = {
mode: 'development',
// mode: 'production',
// watch: true,
devtool: 'inline-source-map',
// context: `${__dirname}`,
entry: {
'tiny': './src/index.js',
'tiny.mini': './src/mini.js',
'plugins/extra': './plugins/extra',
'plugins/particles': './plugins/particles',
'plugins/three': './plugins/three',
'plugins/create': './plugins/create',
'plugins/sound': './plugins/sound',
'plugins/anim': './plugins/anim'
// 'particles_pack': './particles_pack.js',
},
// optimization: {
// minimize: true,
// minimizer: [
// new TerserPlugin({
// include: /\.js$/,
// parallel: true,
// terserOptions: {
// sourceMap: false,
// compress: true,
// ie8: false,
// ecma: 5,
// output: {
// comments: false
// },
// warnings: false
// }
// })
// ]
// },
output: {
path: path.resolve(__dirname, 'examples/libs/tiny'),
filename: '[name].js',
environment: {
arrowFunction: false
}
},
plugins: [
new Webpack.DefinePlugin({
__DEBUG__: 'true'
})
],
stats: {
colors: true
}
// devServer: {
// host: '0.0.0.0',
// port: 3000,
// // hot: true,
// static: {
// directory: path.resolve('examples')
// // watch: true
// }
// }
};
// const compiler = Webpack(webpackConfig);
// const devServerOptions = { ...webpackConfig.devServer, open: true };
// const server = new WebpackDevServer(devServerOptions, compiler);
// const runServer = async () => {
// console.log('Starting server...');
// await server.start();
// };
// runServer();
module.exports = webpackConfig;