klap icon indicating copy to clipboard operation
klap copied to clipboard

Enable support for the experimental syntax 'importAssertions'

Open marcuslindblom opened this issue 4 years ago • 3 comments

In my scripts I have import sheet from "./index.css" assert { type: "css" }; How can I enable this in Klap?

This is the error I get

Add @babel/plugin-syntax-import-assertions (https://git.io/JUbkv) to the 'plugins' section of your Babel config to enable parsing.
(node:67497) UnhandledPromiseRejectionWarning: Error: SyntaxError: /Users/marcus/Library/Mobile Documents/com~apple~CloudDocs/Projects/private/wieldy/src/app/wwwroot/scripts/components/save-button/index.js: Support for the experimental syntax 'importAssertions' isn't currently enabled (5:33):

marcuslindblom avatar Aug 27 '21 09:08 marcuslindblom

👋 @marcuslindblom, Are import assertions ready in babel? I tried adding the @babel/plugin-syntax-import-assertions but it still errors out with invalid syntax. I assume there needs to be a @babel/plugin-transform-import-assertions for this to work?

osdevisnot avatar Aug 28 '21 15:08 osdevisnot

Sorry but I'm not sure, did you manage to make it work?

marcuslindblom avatar Aug 29 '21 16:08 marcuslindblom

@osdevisnot Do you think we can add this feature? I'm not sure how to add plugins to klap so I'm not capable of making a PR. I also found this discussion for rollup https://github.com/rollup/rollup/issues/3799

marcuslindblom avatar Oct 21 '21 18:10 marcuslindblom