V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
mashirozx
V2EX  ›  webpack

Webpack build 出来的 CSS 内资源路径与 dev-server 调试的时候不一样?

  •  
  •   mashirozx · Nov 4, 2019 · 3922 views
    This topic created in 2379 days ago, the information mentioned may be changed or developed.

    webpack-dev-serer 调试的时候,bundle.css 里面某个资源路径是 url(../dist/images/wave.svg),但是等我 npm run build 构建出来的 bundle.css 里面资源路径却变成了 url(../../dist/images/wave.svg),百思不得其解啊。。。

    项目及 webpack.config.js 在这里( Github )

    image

    2 replies    2019-11-04 20:52:41 +08:00
    BaffinLee
        1
    BaffinLee  
       Nov 4, 2019
    output.publicPath 和 devServer.publicPath 不一致
    mashirozx
        2
    mashirozx  
    OP
       Nov 4, 2019
    @BaffinLee #1 感谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3060 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 12:57 · PVG 20:57 · LAX 05:57 · JFK 08:57
    ♥ Do have faith in what you're doing.