Closed gander closed 1 year ago
you can manually fix it by import json
, I will fix this later
// vite.config.ts
import pkg from '@formkit/vue/package.json';
/*
'@formkit/vue': [
'FormKit',
`https://cdn.jsdelivr.net/npm/@formkit/vue@${pkg.version}/dist/formkit-vue.js`,
],
*/
Not working
TS2732: Cannot find module '@formkit/vue/package.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.
Even with config (crash during building):
"resolveJsonModule": true,
use "vite": "3.1.6"
or use fs.readFile
https://github.com/lisonge/pkg-cdn/blob/af3dd82f4a0d161116424179482c70b954cd1ad4/main.ts#L19-L23
fixed by v2.7.1
about @formkit/vue
bug, see @formkit/vue#404
test example see playground/resolve-package-json
I am adding a package that is in the beta:
Then I set up the CDN:
During the build, the following message appears:
The resulting file has an invalid URL to the package:
I am using the following workaround: