Skip to content

Resolvers and transformers #1

@Rich-Harris

Description

@Rich-Harris

Rollup needs to be capable of resolving external modules. The obvious scenario is the one in which external modules live in a node_modules folder, and (at least in some cases) have a jsnext:main field pointing to an ES6 module. Also, it would be good to support jspm_packages.

But we might not want to bundle external modules, so it shouldn't necessarily be the default. Maybe it looks like this:

rollup -i main.js -o bundle.js --resolve npm jspm
rollup.rollup( 'main.js', {
  resolvePath: [ rollup.npm, rollup.jspm ]
}).then( function ( bundle ) {
  /* ... */
});

The other factors to consider are a) whether to try and convert legacy formats to ES6 and b) whether to support loader plugins (e.g. import 'styles.css!' or import data from 'data.json!' or whatever).

Need to bear in mind how all this interacts with transform steps, caches and so on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions