We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
安装 webpack-oss-upload-plugin
npm install webpack-oss-upload-plugin -D
在 webpack config 中使用
const prefix = `${dir}/${projectName}/${version}/`; { output:{ publicPath: `http://e-package.oss-cn-shanghai.aliyuncs.com/${prefix}` }, plugins: [ new WebpackOssUploadPlugin({ // oss 的配置 oss: { region: 'region', endpoint: 'endpoint', accessKeyId: 'accessKeyId', accessKeySecret: 'accessKeySecret', bucket: 'bucket' }, // 上传后的文件路径为:publicPath/{prefix}/your-file.js prefix, // 上传完成后会调用该回调 onComplete: (complication) => { } }) ] }
在 onComplete 的参数暴露了 complication 对象,里面包含当前打包的信息,你可以合理使用它
onComplete
complication
选项说明
prefix: a/c/c/
publicPath/a/b/c/your-file.js
github 地址:https://github.com/Vibing/webpack-oss-plugin
如果你有其他需求或好的建议,请在 issue 中提给我
The text was updated successfully, but these errors were encountered:
No branches or pull requests
该 Webpack 插件用于在本地打包完成后,将打包后的文件上传至 阿里云OSS,并提供上传完成的回调
使用
安装 webpack-oss-upload-plugin
在 webpack config 中使用
在
onComplete
的参数暴露了complication
对象,里面包含当前打包的信息,你可以合理使用它选项说明
prefix: a/c/c/
,那么上传后你的文件位置是:publicPath/a/b/c/your-file.js
complication
对象,里面包含当前打包的信息,你可以合理使用它项目地址
github 地址:https://github.com/Vibing/webpack-oss-plugin
其他
如果你有其他需求或好的建议,请在 issue 中提给我
The text was updated successfully, but these errors were encountered: