-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Warning should not be shown on rollup.config.ts about sourcemaps #1805
Comments
While it is still not super nice, you can pass in plugin options as well via the command line, and this includes compiler options. So something like this should actually work: rollup --config rollup.config.ts --configPlugin 'typescript={compilerOptions:{sourceMap:false}}' This is documented:
But I agree that it would better if this was not necessary. The best solution I can see so far would be to detect specifically the default names of config files in the plugin. |
I tried it and it does get rid of the error and I do still see sourcemaps in my output. I'm not sure why it works though - why does the passed in compilerOptions apply to transpiling the rollup.config.ts and not to the rest of the project? I would have expected it to apply to the project itself. So I don't think this solution is discoverable from the current doc.
Sounds perfect if it's just to turn off the warning in that case |
The configuration is transpiled with a completely separate Rollup run orchestrated by the CLI. I just tried it and again, what I wrote above solved the issue for me. You can still get an error from your regular run, though, which you should fix by specifying the sourcemap option as the error suggests, e.g.
|
Expected Behavior / Situation
I don't get a sourcemap warning message about rollup.config.ts.
Actual Behavior / Situation
When I run rollup with rollup.config.ts, it uses my tsconfig.json which has sourcemap: true because I want sourcemaps, and it gives me an error
@rollup/plugin-typescript: Rollup 'sourcemap' option must be set to generate source maps.
I think my only option to get the warning to go away is to use tsconfig.json for rollup.config.ts only, and use another name like tsconfig.project.json for my actual project.
Modification Proposal
Options:
More context:
https://rollupjs.org/command-line-interface/#configplugin-plugin
#216 (comment)
The text was updated successfully, but these errors were encountered: