You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey hey, and thank you for all the great work!
I've stumbles upon an issue with the importsNotUsedAsValues option in typescript. This option is supposed to fix the need for duplicate import statements when importing a module with both a type export and side-effects, like defining a custom-element.
Without this option, typescript strips all import statements, that only import types. This also gets rid off any side-effects that would happen during the import, see https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues .
This plugin does not seem to honor the setting. I've created a demo project to show the difference in the build output with all three options: tsc, esbuild, and rollup-plugin-esbuild. You can find it here: https://github.com/lucaelin/preserveValueImports-test . I have not included @rollup/plugin-typescript, but it also follows the behavior of tsc.
Would I be possible to have this option honored using this plugin as well? Thanks!
Edit: Fix documentation URL
The text was updated successfully, but these errors were encountered:
I've only now realized that this can be fixed using the tsconfigRaw-option, which also requires removing the tsconfig-option and making sure the file is actually json-compatible to not require additional libraries...
I'll keep it open because this behavior wasn't intuitive to me and might still be worth implementing.
Hey hey, and thank you for all the great work!
I've stumbles upon an issue with the
importsNotUsedAsValues
option in typescript. This option is supposed to fix the need for duplicate import statements when importing a module with both a type export and side-effects, like defining a custom-element.Without this option, typescript strips all import statements, that only import types. This also gets rid off any side-effects that would happen during the import, see https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues .
Starting in
v14
,esbuild
now aligns with behavior oftsc
, see https://github.com/evanw/esbuild/releases/tag/v0.14.0 .This plugin does not seem to honor the setting. I've created a demo project to show the difference in the build output with all three options:
tsc
,esbuild
, androllup-plugin-esbuild
. You can find it here: https://github.com/lucaelin/preserveValueImports-test . I have not included@rollup/plugin-typescript
, but it also follows the behavior oftsc
.Would I be possible to have this option honored using this plugin as well? Thanks!
Edit: Fix documentation URL
The text was updated successfully, but these errors were encountered: