redam

webpack splitChunksPlugin 抽取公共模块的 css 合并的问题

  •  
  •   redam · Mar 11, 2020 · 1668 views
    This topic created in 2261 days ago, the information mentioned may be changed or developed.
    webpack splitChunksPlugin 抽取公共模块时发现一些 [被多个 js import 的 css 文件] 被抽离合并成一个文件,然后没有 import 的 js 对应的 html 在打包后也引入了该文件,导致一些样式出现了冲突,该如何解决?

    =========================================================


    打包前:
    --style.css
    --common.css

    ---a.js //import style.css 、common.css
    ---b.js // import style.css 、common.css
    ---c.js // import style.css

    打包后:
    style.css 、common.css 合并成 styles.bundle.css

    a、b、c 的 html 都引入了 styles.bundle.css ,原本 c.js 并没有引入 common.css ,但打包后却引入了,就可能跟 c 本身引入的其他 css 冲突
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1007 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:20 · PVG 06:20 · LAX 15:20 · JFK 18:20
    ♥ Do have faith in what you're doing.