Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import('axios').then and optimize:true will inject axios cdn in html #84

Open
yinsang opened this issue Mar 4, 2021 · 1 comment
Open

Comments

@yinsang
Copy link

yinsang commented Mar 4, 2021

use react、 react-router and webpack-cdn-plugin。
mainPage not have axios,pageB use axios to fetch sth.

import('axios').then()

While mainPage load CDN axios.min.js is useless.

now : dist/index has CDN of axios, both /mainPage and /pageB use it.
Expect: /mainPage not have CDN of axios, /pageB load bundle of axios like 1.[hash].js or CDN axios, and then fetch sth. so , mainPage can have a better TTI.
demo here, need your response, Please.
cdn-plugin-bug.zip

new WebpackCdnPlugin(
      {
        optimize: true,
        modules: [
          { name: 'axios', var: 'axios', prodUrl: 'https://g.alicdn.com/code/lib/axios/0.21.1/axios.min.js' },
        ]
      }
    )
@yinsang yinsang changed the title import('axios').then will inject axios cdn in html import('axios').then and optimize:true will inject axios cdn in html Mar 4, 2021
@yinsang
Copy link
Author

yinsang commented Mar 10, 2021

need response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant