es-shims / es7-shim

ECMAScript 7 compatibility shims for legacy JavaScript engines
MIT License
173 stars 32 forks source link

publish browser file to npm #54

Closed tracker1 closed 6 years ago

tracker1 commented 6 years ago

I was able to build a dist/es7-shim.browser.js file with the following command (webpack 4 and webpack-cli packages needed)

webpack --output-filename="es7-shim.browser.js" --output-library "__ES7_SHIM__" --output-library-target "this" --mode development --devtool false browser.js

It isn't minified, but is relatively debuggable in this form, and should be usable directly in browser, as well as in extendscript (adobe products) after JSON, es5 and es6 shims/shams.

ljharb commented 6 years ago

If you're installing it from npm, you have access to every build tool (like webpack or browserify) so there's no need to have a pre-bundled file.

If you need a separate dist file (as opposed to properly requiring/importing es7-shim in your entry point(s)), then I'd suggest a postinstall script that creates it in the desired location.