illidanzzz
V2EX  ›  问与答

有熟悉 customize-cra 的吗,通过 config-overrides.js 修改 publicPath 出现问题

  •  
  •   illidanzzz · Nov 11, 2019 · 4298 views
    This topic created in 2460 days ago, the information mentioned may be changed or developed.
    1. 修改了 setWebpackPublicPath 配置
    2. 页面请求 bundle.js 的位置增加了 hostsec,报 404
    3. 实际 bundle.js 的路径不带 hostsec
    const {
      override,
      setWebpackPublicPath
    } = require('customize-cra');
    const path = require('path');
    
    module.exports = override(
      setWebpackPublicPath('/hostsec')
    )
    

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   908 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 21:20 · PVG 05:20 · LAX 14:20 · JFK 17:20
    ♥ Do have faith in what you're doing.