0.0.2 • Published 4 years ago

@cissie/webpack-plugin-cdn v0.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

用于资源打包后上传 CDN 的 webpack 插件

使用说明

1.配置 plugin

import CDNWebpackPlugin from '@cissie/webpack-plugin-cdn';
...
config.plugin('cdn').use(CDNWebpackPlugin);

2.配置 webpack 参数

import { cdnPublicPath } from '@cissie/webpack-plugin-cdn';
...
{
  @cdnPublicPath([?prefix]) // 不传:fe/{name}
  plugins,
  treeShaking: true,
  ...
}

3.通过环境变量 CDN 控制是否上传 cdn

cross-env CDN=true ENV=prod umi build