google / google/closure-compiler

ES6 module rewriting needs configurable base path

Open
#871 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

As discussed here:
https://groups.google.com/d/msg/closure-compiler-discuss/Lh890LsQ8FY/z4nohpYzfdwJ

The standard for other module systems which ES6 is/will probably take is:
- `"path/to/Module"` => absolute path against a base URL, typically html document in browser, and you don't need ".js", it will be added, i.e. `"BASE/path/to/Module.js"`
- `"./OtherModule"` => `"OtherModule.js"` in same folder as importing script
- `"../OtherModule"` => `"OtherModule.js"` in parent folder of importing script

Currently ES6ModuleLoader.NaiveModuleLoader uses JVM current working directory as base for absolute module paths, which isn't always appropriate.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.