在打包后发现点开dist方件;浏览器中一片空白;
我们需要在config文件下的
把assetsPublicPath: "/",
变成:assetsPublicPath: "./",
这个可以让他变成相对路径
把:productionSourceMap: ture,
变成:productionSourceMap: false,
因为这个东西在打包的时候会给你生成很多SourceMap的东西;占用的空间会很大;主要是用来帮助我们调试的;
build: {// Template for index.htmlindex: path.resolve(__dirname, "../dist/index.html"),// PathsassetsRoot: path.resolve(__dirname, "../dist"),assetsSubDirectory: "static",assetsPublicPath: "./",/*** Source Maps*/productionSourceMap: false,// /configuration/devtool/#productiondevtool: "#source-map",// Gzip off by default as many popular static hosts such as// Surge or Netlify already gzip all static assets for you.// Before setting to `true`, make sure to:// npm install --save-dev compression-webpack-pluginproductionGzip: false,productionGzipExtensions: ["js", "css"],// Run the build command with an extra argument to// View the bundle analyzer report after build finishes:// `npm run build --report`// Set to `true` or `false` to always turn it on or offbundleAnalyzerReport: process.env.npm_config_report}
-->index.js