webpack plugins for yqg.
Add a json file to your webpack bundle file with the webpack hash and time.
This can be used to help single page apps detect a new version.
// webpack.config.js
{
plugins: [
new WebpackVersionPlugin(options)
]
}
// Options
interface Options {
filename?: string; // version.json by default
}
{
"version": "44c56d816a031ada87401d28a1339b9a",
"date": "2018-06-26T12:07:16.683Z"
}
Upload Media Sources to qiniu.
// webpack.config.js
{
plugins: [
new WebpackQiniuUploadPlugin(options)
]
}
// Options
interface Options {
bucket: string;
accessKey: string;
secretKey: string;
dir: string; // 一般业务需要配置 bucket,存放资源的目录,比如:'cdn/yqg-tech/static'
}
Add a i18n json file to your webpack build file.
// webpack.config.js
{
plugins: [
new WebpackI18nPlugin(options)
]
}
// Options
interface Options {
filename?: string; // i18n.json by default
getI18nContent?: () => Promise<Object>; // get i18n json content by yourself
}