Cannot import a module for side effects only #2803
Unanswered
jakemckown
asked this question in
Troubleshooting
Replies: 1 comment 2 replies
-
Hi @jakemckown do you have a working repo where I could run your code? That would help me replicate this. I feel like this should work but I'll ask the rest of the maintainers about it. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My project uses brace, an NPM variant of the Ace code editor. To support languages and themes, imports with side effects only are required:
Attempting to
snowpack build --verbose
fails:Both imports cause the error. If I remove the first import to
'brace/mode/python'
, it still fails on the second import:Is there some Snowpack config option to allow modules to run their side effects and then ignore them for the build pipeline? I've seen other projects that use side-effect-only imports and have to imagine they would have similar issues if using Snowpack. For example, TensorFlow.js:
@tensorflow/tfjs/src/index.ts
@tensorflow/tfjs-core/src/index.ts
For reference, here's my current config:
snowpack.config.js
svelte.config.js
Beta Was this translation helpful? Give feedback.
All reactions