-
Notifications
You must be signed in to change notification settings - Fork 54
/
webpack.config.js
45 lines (44 loc) · 1.34 KB
/
webpack.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const CopyPlugin = require("copy-webpack-plugin");
module.exports = [
{
target: 'node',
entry: './index.dist.node.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: "xeokit-convert.cjs.js",
library: {
name: 'convert2xkt',
type: 'umd',
}
},
// optimization: {
// minimize: false
// },
externalsPresets: {node: true}, // in order to ignore built-in modules like path, fs, etc.
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
plugins: [
new CopyPlugin({
patterns: [
{from: "./node_modules/web-ifc/web-ifc.wasm", to: "web-ifc.wasm"}
],
}),
],
devtool: 'source-map'
}
];