Closed stefandesu closed 4 years ago
Would make sense for a demo HTML page where people can edit, validate, and convert JSKOS in the browser. Related resources:
Anyway, this is a larger issue
We should also pay attention to the bundle size. We are using a subset of the Lodash library, but according to BundlePhobia, it adds a whopping 33 kB to our bundle size.
I started with rollup, see https://github.com/gbv/jskos-tools/tree/rollup but stuck
I completed the Rollup configuration, but still need to test if it actually worked as intended.
It seems to work now, but Terser (the tool I used for minification) shows all kinds of warnings and it feels like something is broken:
index.js → dist/jskos-tools.umd.js...
babelHelpers: 'bundled' option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
(!) Plugin terser: Dropping duplicated definition of variable desc [0:313,8]
rollupPluginBabelHelpers.js
(!) Plugin terser: Condition left of && always true [0:7,20]
node_modules/lodash/_cloneBuffer.js
node_modules/lodash/_nodeUtil.js
(!) Plugin terser: Dropping side-effect-free && [0:10,19]
node_modules/lodash/_cloneBuffer.js
node_modules/lodash/_nodeUtil.js
(!) Plugin terser: Condition left of && always true [0:8,20]
node_modules/lodash/isBuffer.js
(!) Plugin terser: Dropping side-effect-free && [0:11,19]
node_modules/lodash/isBuffer.js
(!) Plugin terser: Dropping unreachable code [0:45,2]
node_modules/lodash/_baseIsNative.js
(!) Plugin terser: Declarations in unreachable code! [0:45,2]
node_modules/lodash/_baseIsNative.js
created dist/jskos-tools.umd.js in 4.2s
I removed minification because jsDelivr has it built-in.
To directly use with a script tag.