Skip to content

Support for module field #859

Closed
Closed
@fregante

Description

@fregante

The package webext-dynamic-content-scripts does not have a main file but only a module file.

eslint-plugin-import is marking it as:

Unable to resolve path to module webext-dynamic-content-scripts.  import/no-unresolved

Example:

import i from 'webext-dynamic-content-scripts';
i();

For reference, both webpack@2 and rollup (+ its node resolution plugin) can successfully bundle it:

npm i rollup
npm i rollup-config-webext # configuration for npm resolution
npm i webpack

echo "import i from 'webext-dynamic-content-scripts';i()" > input.js;

rollup --config node:webext input.js
webpack a.js b.js && cat b.js

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