diff --git a/build/utils.js b/build/utils.js index 5afbde6a..25a7f24e 100755 --- a/build/utils.js +++ b/build/utils.js @@ -32,7 +32,10 @@ exports.cssLoaders = options => { if (options.extract) { return ExtractTextPlugin.extract({ use: sourceLoader, - fallback: 'vue-style-loader' + fallback: 'vue-style-loader', + // Fixed the problem that the URLs of fonts and images in the css files are incorrect + // when assetsPublicPath set to './' in production environment + publicPath: '../../' }) } else { return ['vue-style-loader', sourceLoader].join('!') diff --git a/config/index.js b/config/index.js index c43ec8c6..106f7e09 100755 --- a/config/index.js +++ b/config/index.js @@ -9,7 +9,7 @@ module.exports = { index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'assets', - assetsPublicPath: '/', + assetsPublicPath: './', productionSourceMap: true, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you.