plugin-asset-prefix
v6.1.1
Published
This plugin to set the URL prefix for static assets, such as setting it to a CDN URL.
Downloads
171
Maintainers
Readme
plugin-asset-prefix
This plugin to set the URL prefix for static assets, such as setting it to a CDN URL.
install
npm i plugin-asset-prefix
or
yarn add plugin-asset-prefix
or
pnpm add plugin-asset-prefix
usage
pluginAssetPath({
domainMap: {
daily: '//assets-test.domain.cn',
pre: '//pre-assets.domain.cn',
production: '//assets.domain.cn',
},
groupName: 'group-name',
projectName: 'project-name',
})
Automatically set asset prefix based on current node environment variables. The value like,
`${domain}${groupName}${projectName}${version}/`
Ensure
process.env.BUILD_ARGV_STR
is an object string and contains thedef_publish_env
anddef_publish_version
attributes.