illidanzzz
V2EX  ›  问与答

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

  •  
  •   illidanzzz · Nov 11, 2019 · 4292 views
    This topic created in 2456 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   ·   2630 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 11:34 · PVG 19:34 · LAX 04:34 · JFK 07:34
    ♥ Do have faith in what you're doing.