Skip to content

babel seems to mess with the ES export #30

@maxlath

Description

@maxlath

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions