webpack-cdn-plugin icon indicating copy to clipboard operation
webpack-cdn-plugin copied to clipboard

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

Open yinsang opened this issue 4 years ago • 1 comments

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 avatar Mar 04 '21 13:03 yinsang

need response

yinsang avatar Mar 10 '21 02:03 yinsang