Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.
This repository was archived by the owner on May 26, 2022. It is now read-only.

Support for ES6 'goog:foo.bar.baz' imports #12

@jdb8

Description

@jdb8

The latest versions of google closure support es6 modules, as well as closure-specific module syntax in the form of import foo from 'goog:foo.bar.baz'. This allows for files (for example, the google closure js library itself) to continue to goog.provide('foo.bar.baz') while having their code imported into es6 modules.

Would it be simple to make this work with the loader, and correctly resolve both new- and old-style imports/requires? I've had a first attempt at modifying the loader, adding an additional regex in the form of ^import (.+) from ['"]goog:(.+)['"], but can't get things working yet: I intend to continue testing this out but thought I'd post here in the meantime in case there's any existing work on this or any roadblocks I'm overlooking.

Just to clarify, my intention would be only to transpile these special prefixed imports, and leave the pure es6 imports down to something like babel-loader since that feels more appropriate.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions