This repository was archived by the owner on Feb 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathwebpack.config.babel.js
More file actions
74 lines (68 loc) · 1.48 KB
/
webpack.config.babel.js
File metadata and controls
74 lines (68 loc) · 1.48 KB
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
/* eslint-disable import/no-extraneous-dependencies */
import path from 'path';
import webpack from 'webpack';
import pluginsWithoutUglify from './config/webpackPluginsWithoutUglify';
import packageJson from './package.json';
const outPath = path.join(__dirname, 'pages');
const plugins = pluginsWithoutUglify.concat([
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
mangle: true,
}),
]);
const babelLoaderConfigShared = {
test: /\.jsx?$/,
loader: 'babel-loader',
query: {
...packageJson.babel,
cacheDirectory: true,
},
};
export default {
entry: {
app: [
'./src/index.jsx',
],
advanced: [
'./src/examples/AdvancedExample/index.js',
],
},
output: {
path: outPath,
filename: path.join('js', 'bundle-[name].js'),
},
module: {
loaders: [
{
loader: 'json-loader',
test: /\.json$/,
},
{
exclude: /node_modules/,
...babelLoaderConfigShared,
},
{
include: /react-three-renderer[\\/]src/,
...babelLoaderConfigShared,
},
],
},
resolve: {
extensions: ['.js', '.jsx'],
alias: {
// use the source files
'react-three-renderer': path.join(
__dirname, 'node_modules', 'react-three-renderer', 'src'),
},
},
devServer: {
contentBase: path.join(__dirname, 'assets'),
// noInfo: true, // --no-info option
hot: true,
inline: true,
stats: { colors: true },
},
plugins,
};