webpack Public Path All In One
webpack Public Path All In One
if (window.__POWERED_BY_XGQFRMS__) {
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_XGQFRMS__;
}
public-path
https://webpack.js.org/guides/public-path/
https://webpack.js.org/configuration/output/#outputpublicpath
import webpack from 'webpack';
// Try the environment variable, otherwise use root
const ASSET_PATH = process.env.ASSET_PATH || '/';
export default {
output: {
publicPath: ASSET_PATH,
},
plugins: [
// This makes it possible for us to safely use env vars on our code
new webpack.DefinePlugin({
'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH),
}),
],
};
__webpack_public_path__ = process.env.ASSET_PATH;
refs
https://qiankun.umijs.org/zh/guide/tutorial#微应用
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/15059477.html
未经授权禁止转载,违者必究!