Comments (4)
@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.
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.
@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.
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)
- One error occurred after adding dynamic-cdn-webpack-plugin HOT 5
- incompatibility with html-webpack-inline-source-plugin HOT 12
- doesn't parse other libraries HOT 4
- not working with webpack externals parameter HOT 1
- Add `module-to-cdn` as dependency HOT 5
- [Propostion] New API to instantiate plugin for diff supported output plugin HOT 7
- Vendor code still in my bundle HOT 4
- Can't figure out a basic scenario working with my own CDN and packages HOT 4
- 99.9% of my packages could not be found, but they exist in CDN HOT 2
- Dependency issue with babel-runtime HOT 5
- Is there a way to configure script injections? HOT 1
- Optional and peer dependencies HOT 7
- [Bug] Module isn't auto loaded from CDN URL at runtime. Is it meant to be? HOT 1
- Missing dependencies HOT 3
- Manually script injections order. HOT 2
- Building project includes dependency even when dynamic-cdn-webpack-plugin is set up HOT 1
- feat: work with webpack-manifest-plugin
- want to use dynamically inside monaco editor, so as the user writes imports it should be added in the index.html
- Webpack 5 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamic-cdn-webpack-plugin.