forked from w3reality/three-geo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathes-pack.config.js
25 lines (22 loc) · 924 Bytes
/
es-pack.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
const path = require('path');
const fs = require('fs');
module.exports = {
onBundle: (webpackConfig, webpack) => {
webpackConfig.externals = {'three': 'THREE'};
webpackConfig.performance = {hints: false};
webpackConfig.plugins.push(
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}));
},
onVerify: (preloadJs, units) => {
const pathUpper = path.resolve(__dirname, './node_modules/THREE');
if (!fs.existsSync(pathUpper)) { // can be true on linux (case-sensitive fs)
// ├── node_modules
// │ └── THREE -> ./three
try { fs.symlinkSync('./three', pathUpper); } catch (_) {}
}
preloadJs.node = path.resolve(__dirname, './tests/node/preload.js');
preloadJs.browser = path.resolve(__dirname, './node_modules/three/build/three.min.js');
},
};