Skip to content

Feature for treating non-existent, relative files as external files #532

Description

@internettrans

#410 and #418 (as explained in the wiki) make it possible to treat relative files as external by putting path.resolve('./relative-dep.js') into the externals array of your rollup configuration. However, as far as I can tell, that approach for skipping relative files will only work if the file exists (otherwise path.resolve will fail inside of the rollup configuration).

The use case for skipping a relative import without there being a file of the same name is for bundling projects that will later be System.imported (using SystemJS). The reason why the import does not match the relative filename exactly is because the project specifies which SystemJS plugin to use when loading the relative import. For example, my file tree may look like this:

src
-->main.js
-->main.css

where main.js is

import './main.css!cssmodules';
...

Is there a way I am unware of that allows for you to skip ./main.css!cssmodules when the filename is really just ./main.css??

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