Webpack: Default `assetsPublicPath` value

Created on 18 Oct 2017  路  2Comments  路  Source: vuejs-templates/webpack

Hi all,

I'm a VueJS newbie, just learning all the stuff.

Value assetsPublicPath in config/index.js has a default value "/", which implies that the project must live in the server's root directory.

If I change the value to "" (empty string), it seems to work in any directory as it uses relative paths. Is there a particular reason why this is not the default configuration?

Thanks for clarification.

question

Most helpful comment

The main point is that Vue-Router in history mode requires absolute paths to work properly.

All 2 comments

The main point is that Vue-Router in history mode requires absolute paths to work properly.

@LinusBorg I've got it. When I use Vue-Router with mode: "history", relative path to static directory lose its meaning. Thanks.

Was this page helpful?
0 / 5 - 0 ratings