mathiasbynens / punycode.js

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891.
https://mths.be/punycode
MIT License
1.59k stars 158 forks source link

Any plans to support es6 import/export? #116

Open bentaly opened 2 years ago

bentaly commented 2 years ago

I use this module in an Angular application and have a warning:

Warning: `filename.ts` depends on 'punycode'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

And I import using import { toASCII } from 'punycode';

Do you have any plans to support es6 modules?

steffanhalv commented 2 years ago

If the built version of punycode.es6.js can be renamed to punycode.es6.mjs it will be possible to use it in esm projects with regular import, ex. import punycode from 'punycode/punycode.es6.mjs'