-
Notifications
You must be signed in to change notification settings - Fork 142
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
Test v2 addon as a type=module package #1572
base: stable
Are you sure you want to change the base?
Test v2 addon as a type=module package #1572
Conversation
b1cabdb
to
572ebd5
Compare
I found an approach that fixes this particular case: diff --git a/packages/webpack/src/webpack-resolver-plugin.ts b/packages/webpack/src/webpack-resolver-plugin.ts
index b832434d..c0286b94 100644
--- a/packages/webpack/src/webpack-resolver-plugin.ts
+++ b/packages/webpack/src/webpack-resolver-plugin.ts
@@ -165,6 +165,7 @@ class WebpackModuleRequest implements ModuleRequest {
if (this.fromFile === newFromFile) {
return this;
} else {
+ delete (this.state as any).resolveOptions;
this.state.contextInfo.issuer = newFromFile;
this.state.context = dirname(newFromFile);
return new WebpackModuleRequest(this.babelLoaderPrefix, this.appRoot, this.state) as this; The reason our initial attempt to mutate Next step here would be to figure out what we need to do with A related question is: can we stop mutating |
looks like this is a problem with I can't reproduce the behavior in the tests correctly, but import { importSync } from '@embroider/macros';
export const two = 2;
importSync('./violations.css'); without importSync, type=module appears to work ok.
|
Looks like there are a few things happening here -- gonna have separate issue for them all.
|
Info from @mansona, |
572ebd5
to
e6fcbbb
Compare
@NullVoxPopuli is it worth trying again since #1686 was merged and we support the exports with |
e6fcbbb
to
384d8f5
Compare
I found that things work ok in the test environment without interacting with the Basic |
Addon-main is cjs, it should have cjs extension Reproduction success Make separate scenario Test file must end with -test Need to update the app's ember-cli-babel Test is passing, now let's break it again... Break successful
e7a924e
to
698cfcf
Compare
Ran in to an issue with type=module over here ember-primitives#33 - ci-logs
and wanted to see if it was reproducible in a stripped down environment (it is!)