Add support for ES6 browser import
lpellegr opened this issue · 7 comments
It seems the library cannot be loaded with module imports on modern browsers.
The purpose would be to allow such imports since JavaScript imports are now available with all major browsers. Including an esm file or adapting existing files in the NPM package to have a default or another export would allow something like the following:
import psl from 'psl';
It would also be nice to be able to import only the desired function:
import {parse} from 'psl';
On v1.8.0 I get this warning (in an Angular v10 project) :
WARNING in /home/.../Projects/...edit.component.ts depends on 'psl'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Is there any news on this?
Issue has been pending for more than 2 years. Could we have this pretty basic fix merged ?
I would really appreciate it since the bundle size is very big in my opinion.
I suggest you looking at https://github.com/remusao/tldts. The library provides what psl does (and more) along with ESM support and active maintenance!