forked from flowers1225/threejs-earth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dll.js
77 lines (73 loc) · 2.47 KB
/
webpack.dll.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
/**
* Created by z on 2017/5/31.
*/
const path = require('path');
const webpack = require('webpack');
const DllPlugin = webpack.DllPlugin;
const threeModule = path.join(__dirname, '/node_modules/three/');
const TrackballControls = path.join(threeModule, 'examples/js/controls/TrackballControls.js');
const EffectComposer = path.join(threeModule, 'examples/js/postprocessing/EffectComposer.js');
const RenderPass = path.join(threeModule, 'examples/js/postprocessing/RenderPass.js');
const ShaderPass = path.join(threeModule, 'examples/js/postprocessing/ShaderPass.js');
const MaskPass = path.join(threeModule, 'examples/js/postprocessing/MaskPass.js');
const CopyShader = path.join(threeModule, 'examples/js/shaders/CopyShader.js');
module.exports = {
entry: {
vendor: ['three', TrackballControls, EffectComposer, RenderPass, ShaderPass, MaskPass, CopyShader],
},
output: {
path: '.',
filename: './dist/js/[name].js',
library: '[name]_library'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|dist)/,
loaders: ['babel-loader', 'eslint-loader']
},
{
test: /TrackballControls\.js/,
loader: 'imports?THREE=three!exports?THREE.TrackballControls'
},
{
test: /EffectComposer\.js/,
loader: 'imports?THREE=three!exports?THREE.EffectComposer'
},
{
test: /RenderPass\.js/,
loader: 'imports?THREE=three!exports?THREE.RenderPass'
},
{
test: /ShaderPass\.js/,
loader: 'imports?THREE=three!exports?THREE.ShaderPass'
},
{
test: /MaskPass\.js/,
loader: 'imports?THREE=three!exports?THREE.MaskPass'
},
{
test: /CopyShader\.js/,
loader: 'imports?THREE=three!exports?THREE.CopyShader'
}
]
},
resolve: {
alias: {
'TrackballControls': TrackballControls,
'EffectComposer': EffectComposer,
'RenderPass': RenderPass,
'ShaderPass': ShaderPass,
'MaskPass': MaskPass,
'CopyShader': CopyShader,
}
},
plugins: [
new DllPlugin({
path: 'manifest.json',
name: '[name]_library',
context: __dirname,
}),
]
};