Closed trsh closed 5 years ago
I actually think the coolest thing would be a 3rd build > like xx-xx-plugin.raw.min.js
, that contains no polys!!! Coders than can choose to add or not them with external link :)).. depending on browser requirements.
Minified bundle (especially transpiled from ES8 to olders versions) without polyfills can causing errors such as asyncIterator is not defined
or similar. This is an extra complexity that gives more errors than good.
I think the best solution would be to add "module" property to package.json of each plugin.
"module": "build/some-plugin.debug.js",
This way when building your application using webpack it will import *.debug.js
for import SomePlugin from 'rete-some-plugin';
*.debug.js
does not have polyfills, since the source code is not converted to older versions. Converting to old versions is going with webpack (if you configure it)
Since v1.0.2 there is ES modules without polyfills (built by rete-cli@0.4.2).
*.esm.js
hasn't polyfills and not minified.
*.min.js
has polyfills and minified.
*.esm.js
may be minified during the build of your project. It allows to reduce a bandle by ~5kb due to the exclusion of polyfills.
@trsh starting from rete-cli@0.5.0 (and rete@1.0.3) we have three formats of bundle:
*.min.js
with a polyfill and minified*.common.js
*.esm.js
@Ni55aN cool, tnx. Pretty busy lately with other stuff :/