0.0.2 • Published 2 years ago
dynamic-path-webpack-plugin v0.0.2
环境要求
nodejs > 16.13.0
描述
根据后台配置的 cdn 地址配置进行静态资源的替换的 webpack plugin;
使用方法
config.plugin("dynamic-path-webpack-plugin").use(CdnPlugin, [
{
outputDir: resolve("dist"),
loadSourceConfig : {}
},
]);
参数说明
outputDir(必传)
项目打包输出路径
- loadSourceConfig(可选)
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
filePath | 加载的文件地址路径(最终地址由url+path拼接而成) | String | 'sourceConfig.json' |
staticUrl | 加载配置文件静态地址(比如:从固定地址:http://xxx.xx.xxx/ | String | '' |
sourcePath | 最终资源加载的相对目录 | String | '' |
insertTimeout | 在获取到配置后多少秒进行插入静态资源 | Number | 200 |
retryCount | 重试次数(每隔200ms获取一次配置路径,默认会尝试2000ms) | Number | 10 |
0.0.2
2 years ago