Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make extensions end in mjs file extension type #26340

Merged
merged 8 commits into from Feb 9, 2020

Conversation

erwinmombay
Copy link
Member

@erwinmombay erwinmombay commented Jan 14, 2020

when running gulp dist --esm we need to differentiate the modern js binaries from old generated binaries. We will suffix the file with .mjs. The output has not been changed

The solution in this pR is not optimal as it checks calls maybeToEsmName a few many times. This can be optimized by plumbing through the option throughout all the calls but that will take me a bit more time which I'll do in a follow up PR.

i'll also follow up with a PR to update a single example page with the mjs example. trying to do all of examples dynamically is more difficult since we only do string manipulation (we regex the url strings) while the mjs changes needs dom manipulation (needs to append multiple script tags and add attributes etc)

@rsimha
Copy link
Contributor

rsimha commented Feb 5, 2020

As discussed offline, I think this can be done more elegantly, by centralizing the file nomenclature in bundles.config.js, but I'm fine doing this via a separate refactor.

@erwinmombay erwinmombay merged commit af50ae0 into ampproject:master Feb 9, 2020
erwinmombay added a commit that referenced this pull request Feb 11, 2020
* make extensions end in mjs file extension type

* lint fixes

* add test page

* lint fixes

* change names to mjs for calls to createModuleCompatibleES5Bundle

* fix config not getting applied to the built main binaries

* temp

* add sourceMappingURL back since gulp-sourcemaps doesnt support it
erwinmombay added a commit that referenced this pull request Feb 11, 2020
* make extensions end in mjs file extension type

* lint fixes

* add test page

* lint fixes

* change names to mjs for calls to createModuleCompatibleES5Bundle

* fix config not getting applied to the built main binaries

* temp

* add sourceMappingURL back since gulp-sourcemaps doesnt support it
erwinmombay added a commit that referenced this pull request Feb 18, 2020
* make extensions end in mjs file extension type

* lint fixes

* add test page

* lint fixes

* change names to mjs for calls to createModuleCompatibleES5Bundle

* fix config not getting applied to the built main binaries

* temp

* add sourceMappingURL back since gulp-sourcemaps doesnt support it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants