Closed rhinonan closed 3 years ago
use relative path with ../
like import CloudsecAlert from '../node_modules/@sxf/cloudsec-components/src/packages/alert/index.vue';
it's worked.
any better solution?
In your @sxf/cloudsec-components
, you should define
exports: {
"./*": "./*"
}
in your package.json
to expose the nested files.
After trying all the methods
I finally solved my problem completely with @originjs/vite-plugin-commonjs
, it will help you
@rhinonan
I need import some .vue files from node_modules.
but I got error
I was use vue-cli before. In vue-cli , we can use
transpileDependencies: ['@sxf/cloudsec-components']
。So, how can i import .vue files from node_modules with
vite-plugin-vue2
orvite
?