-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
bundler: __default
is not defined when using named imports
#3628
Comments
Are you using bundler? |
__default
is not defined when using named imports__default
is not defined when using named imports
What I did in the meantime was to use Ah, I changed the repo visibility to private since creating this issue. spack.config.js const fs = require('fs');
const { config } = require('@swc/core/spack');
// Use the same options for spack as the ones in the .swcrc file (better intellisense there)
const options = JSON.parse(fs.readFileSync('.swcrc', { encoding: 'utf8', flag: 'r' }));
module.exports = config({
entry: {
'univers': __dirname + '/src/Stacker X - [PPO] Plateforme Univers - univers.propulseo.unly.org/index.ts',
},
output: {
path: __dirname + '/dist',
},
module: {},
mode: 'production',
target: 'browser',
options,
}); |
Here's a pretty straightforward repro gist https://gist.github.com/Stuk/4e1c11e867c720608a1c7bee129654ca. Specifically in the output the following incorrect line appears: return __default.createElement("div", null, hour, ":", minute, ":", second); |
+1 , is there any way to resolve it ? |
This is becoming more and more of a daily issue, I cannot use TypeScript properly.
What I really want is to take a bunch of JS/TS files and make a single dist file that's browser-compatible, I feel like I'm using the wrong solution. |
Is this on the roadmap? I'm looking for a tool that allows bundling different output files (like Spack does), but I'd prefer using TS and Import, which is currently not possible. |
Describe the bug
When importing a file with named exports, the function code isn't present in the output. A
__default
call is present but doesn't reference anything.Input code
Config
Playground link
https://github.com/UnlyEd/stacker-public-scripts/blob/issue-_default/spack.config.js
Expected behavior
The function
findStackerUser
is not present in the output, it should be.Actual behavior
Yield the following output:
Version
1.2.142
Additional context
No response
The text was updated successfully, but these errors were encountered: