Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel seems to mess with the ES export #30

Open
maxlath opened this issue Dec 12, 2023 · 0 comments
Open

babel seems to mess with the ES export #30

maxlath opened this issue Dec 12, 2023 · 0 comments

Comments

@maxlath
Copy link

maxlath commented Dec 12, 2023

Hi!

// in src/index.js
export default function

becomes

// in dist/index.js
exports.default = function () {

so the ES import currently needs to look like this:

import WAE from 'web-auto-extractor'
WAE.default().parse(html)

instead of

import WAE from 'web-auto-extractor'
WAE.parse(html)

which is what the readme says.

That could maybe be solved by making ES imports directly import the src files, something like this:

// in package.json
{
    "exports": {
        "import": "./src/index.js",
        "require": "./dist/index.js"
    }
}

see documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant