Code Monkey home page Code Monkey logo

Comments (4)

mspinelli avatar mspinelli commented on June 8, 2024 1

@mspinelli the default cdn resolver might not have those packages. I'm a bit caught up with stuff this week but I'll try to look into this next week.

@aulisius Correct and thanks! I ended up doing this (and turning verbose on showed that being the issue).

I also needed to do this:

    plugins: [
      new DynamicCdnWebpackPlugin({
        verbose: true,
        env: 'production',
        resolver: (packageName, packageVersion) => {
          return {
            name: packageName,
            var: packageName.replace('@', ''),
            version: packageVersion,
            url: `https://cdn.jsdelivr.net/npm/${packageName}@${packageVersion}/dist/${packageName}.min.js`
          }
        },
        only: [
          'vue-apexcharts',
          'apexcharts'
        ]
      })

from dynamic-cdn-webpack-plugin.

mspinelli avatar mspinelli commented on June 8, 2024

I'm also curious about if there are issues with this working with Nuxt.JS (Vue's version of Nuxt.JS). The following config doesn't seem to use the cdn to load the two apexcharts packages (and still distributes them). Do I need to move them from dependencies to devDependencies?

  // nuxt.config.js
  ...
  build: {
    plugins: [
      new HtmlWebpackPlugin(),
      new DynamicCdnWebpackPlugin({
        only: [
          'vue-apexcharts',
          'apexcharts'
        ]
      })     
    ]
  }
  ...
  // package.json
  ...
  "dependencies": {
    "apexcharts": "^3.26.0",
    "core-js": "^3.9.1",
    "nuxt": "^2.15.3",
    "vue-apexcharts": "^1.6.1",
  },
  ...

from dynamic-cdn-webpack-plugin.

aulisius avatar aulisius commented on June 8, 2024

@mspinelli the default cdn resolver might not have those packages. I'm a bit caught up with stuff this week but I'll try to look into this next week.

from dynamic-cdn-webpack-plugin.

cuongdevjs avatar cuongdevjs commented on June 8, 2024

any update for nextjs. I config on next.config.js but it does not work, when I run my web throw error:

external "React":1 Uncaught ReferenceError: React is not defined

from dynamic-cdn-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.