webpack打包配置項 在config.js 中 module.exports = {publicPath: process.env.NODE_ENV === 'production' ? '/' : '/', //靜態資源目錄outputDir: 'dist', //打包名稱assetsDir: 'static',//靜態資源,目錄devServer: {port: port,open: false,overlay: {warnings: false,errors: true},proxy: {//配置跨域"/api":{target:'http://localhost:3000', //代理服務器changeOrigin: true,pathRewrite: {"^/api": "/"}},}},configureWebpack:{name: name,resolve: {alias: {'@': resolve('src') //@可以直接訪問src目錄下的文件}},plugins: [new FileManagerPlugin({events: {onEnd: {delete: ['./dist.zip'],//列出了應該被刪除的文件或目錄archive: [{source: './dist', destination: `./dist.zip`}]//source應該被壓縮的源文件或目錄//destination壓縮后的文件應該被保存的位置和名稱}}})]} }