MMF-FE / vite-plugin-cdn-import

Import modules from CDN with vite plugin
MIT License
208 stars 30 forks source link

error : SyntaxError: Unexpected token (1:0) when using vuetify #5

Closed radiorz closed 3 years ago

radiorz commented 3 years ago

I download the vuetify.min.js from https://cdn.jsdelivr.net/ and save it into ./public/lib/vuetify.min.js in my project. and I use importTOCDN like this:


  plugins: [
    importToCDN({
      modules: [
        {
          name: 'vuetify',
          var: 'Vuetify',
          path: `lib/vuetify.min.js`
        }
      ]
    }),
...

But it return error:

Error: The configuration of module vuetify does not exist 
Jianazheng commented 3 years ago

Please install at first. Run the following command line.

yarn add vuetify

or

npm install vuetify