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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output format of default target not respected #6755
Comments
It should be
|
@mischnic Thanks. But this doesn't seem to work. It still outputs as "global". What does work is changing the target name. I just added it into the "Possible Solutions" section. |
Are you sure? The outputFormat config in your "Possible Solutions" example is still wrong |
@mischnic Weird. I was sure I read that somewhere. I tested it more, and the ES module is correctly exported using either "targets": {
"module": {
"outputFormat": "esmodule"
}
} or "targets": {
"module": {
"engines": {
"outputFormat": "esmodule"
}
}
} but neither using "targets": {
"default": {
"outputFormat": "esmodule"
}
} nor "targets": {
"default": {
"engines": {
"outputFormat": "esmodule"
}
}
} EDIT: It doesn't actually work with any target name "foobar" but has to be "module". Another bug? |
This is just ignored:
then |
All the issues still appear when the "engines" is not present, like for example "targets": {
"foobar": {
"outputFormat": "esmodule"
}
} outputs an IIFE. I count 3 bugs here. I clarified them in my post. |
This is indeed a bug. This is working correctly for me: "targets": {
"default": {
"outputFormat": "esmodule",
"isLibrary": true
}
}, |
There's an object defining Common targets in TargetRequst.js which seems to ignore certain settings, including |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
馃悰 bug report
Specifying the output format of the target "default" in the
package.json
has no effect. It works fine with any other target name.EDIT: No, actually only the target name "module". It doesn't seem to work with any other target name. Another bug?
馃帥 Configuration (.babelrc, package.json, cli command)
package.json
馃 Expected Behavior
The file is an ES module.
馃槸 Current Behavior
The file is an IIFE, as produced by the default output format
global
.馃拋 Possible Solution
A workaround is to use the target name "module". But then it uses that target name as subdirectory of the output directory. To actually use the default output directory of the "default" target, one has to set the
distDir
explicitly. This is cumbersome. It would be easier if we could just overwrite the output format of the default target.So, in other words, the
package.json
could look like thisEDIT 2: Actually this still uses the output subdirectory "module", so the
distDir
is somehow not applied for the target name "module". Yet another bug?馃敠 Context
I want to bundle up some Elm code into an ES module.
馃捇 Code Sample
馃實 Your Environment
The text was updated successfully, but these errors were encountered: