Skip to content

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

@yinsang

Description

@yinsang

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' },
        ]
      }
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions