Can't use import `assert {"type":"json"}``

whenever I try to import a .json document with the assert specified, i get errors about missing babel plugins, but I'm not able to add a babel plugin. Small repro here: https://github.com/birkskyum/solid-import-assertions
GitHub
GitHub - birkskyum/solid-import-assertions
Contribute to birkskyum/solid-import-assertions development by creating an account on GitHub.
1 Reply
Birk Skyum
Birk Skyum3mo ago
Ended up adding the solid entry with a babel plugin, and it did the trick even though typescript complained:
export default defineConfig({
ssr: true,
solid: {
babel: {
plugins: [
[
'@babel/plugin-syntax-import-attributes',
{
deprecatedAssertSyntax: true,
},
],
],
}
},
server: {
preset: 'static',
baseURL: '/maplibre-style-spec',
}
});
export default defineConfig({
ssr: true,
solid: {
babel: {
plugins: [
[
'@babel/plugin-syntax-import-attributes',
{
deprecatedAssertSyntax: true,
},
],
],
}
},
server: {
preset: 'static',
baseURL: '/maplibre-style-spec',
}
});