-
-
Notifications
You must be signed in to change notification settings - Fork 578
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
rspack.config.ts configuration error #3609
Comments
I could help you solve the issue with a long conversation, but the simplest way is to use If you want type checking with // @ts-check
/** @type {import('@rspack/cli').Configuration} */
const config = {
entry: {
main: './src/index.js',
},
};
module.exports = config; |
https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require |
we should support export default case in future, let me test whether #3222 fix it |
@ICJR it's supported now, you can test on @rspack/[email protected] |
System Info
System:
OS: Windows 10 10.0.19045
CPU: (12) x64 Intel(R) Core(TM) i7
Memory: 20.73 GB / 31.91 GB
Binaries:
Node: 18.12.0 - C:\Program Files\n
npm: 9.2.0 - C:\Program Files\node
Browsers:
Edge: Spartan (44.19041.1266.0), C
Internet Explorer: 11.0.19041.1566
Details
I've installed
ts-node
and converted myrspack.config.js
file to a typescript file but I believe the docs are incorrect and ts support does not work withexport default
documentation shows configuration object being exported using
export = config
I don't think that's valid ( vscode throws an error as well )When I use
export default config
I receiveReproduce link
No response
Reproduce Steps
Create a rspack config using typescript
Build
The text was updated successfully, but these errors were encountered: