How to create ES5 bundle
dknezevic opened this issue · 4 comments
dknezevic commented
I need to build a es5 build of the viewer but I can not seem to do it properly.
Is it even possible and what is the correct way to do it?
xeolabs commented
We only build ES6 because that's what users/partners have needed so far.
Should be nothing stopping this repo from being built to ES5, however, with the right configs.
If you'd like to contribute an ES5 build config, or any source code tweeks needed for that, PR's always welcome.
dknezevic commented
Thanks for the quick reply.
All I had to do to add support for es5 is extend the rollup.config.js and build the umd version.
import {nodeResolve} from '@rollup/plugin-node-resolve';
import {terser} from "rollup-plugin-terser";
export default {
input: './index.js',
output: [{
file: './dist/xeokit-bim-viewer.es.js',
format: 'es',
name: 'BIM'
},
{
file: './dist/xeokit-bim-viewer.umd.js',
format: 'umd',
name: 'BIM'
}],
plugins: [
nodeResolve(),
terser()
]
}
xeolabs commented
Nice, thanks! Would you like to put that in a PR, and get the glory?
dknezevic commented
Done!