Webpack公共资源路径增加了一个参数

时间:2018-04-18 23:30:20

标签: webpack vuejs2

使用vue + webpack,一切正常,但是当转到子路由时,请按F5 webpack或vue更改路径。

实施例

子路线localhost:8080/user/config/

F5之后的

资产路径变为localhost:8080/user/static/css但不必更改路径资产,并将其保留为localhost:8080/static/css

vue js config:

dev: {
env: require('./dev.env'),
port: 8080,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
// assetsPublicPath: '/',
proxyTable: {},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false

}

0 个答案:

没有答案