在我的/build文件夹中,我的反应前端都被很好地打包、丑陋和分块。我希望自动将目录压缩到快照中,并将其上传到maven存储库。
我一直在查看文档,在我的一生中,我无法确定是否可以在我的webpack.config.js中设置它,并在内容打包之后自动完成它。
发布于 2017-02-06 11:36:00
我使用webpack-shell-plugin来归档已编译的文件。我编译的文件是“dist”目录。
const WebpackShellPlugin = require('webpack-shell-plugin')导入它。const CREATE_ARCHIVE = 'tar czvf --ignore-failed-read ' + paths.base() + '/bundle.tar.gz' + ' -C ' + paths.dist() + ' . 'webpackConfig.plugins.push( new webpack.optimize.OccurrenceOrderPlugin(), //.. other plugins, new WebpackShellPlugin({ onBuildExit: [CREATE_ARCHIVE], safe: true }) )在运行webpack构建之后,它会在项目的根中创建build.tar.gz。
https://stackoverflow.com/questions/36209052
复制相似问题