Skip to content

怎么在umijs打包出来的umi.js和umi.css路径上添加前缀? #11881

Answered by fz6m
xf11075 asked this question in Q&A
Discussion options

You must be logged in to vote

产物的静态资源 dist 整个文件夹发到 CDN 上的话,要配 publicPath ,比如配了 https://domain.com/path/ ,最后就会从 https://domain.com/path/umi.js 加载:

// .umirc.ts

  publicPath: process.env.NODE_ENV === 'production' ? 'https://domain.com/path/' : '/'

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@xileliu
Comment options

@xiaohuoni
Comment options

Answer selected by xiaohuoni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants