I tried to change build config and make the project build to different directory(out of project's root directory). Soon after that, I found out that npm run dev no longer works and returns cannot get '/'.
I managed to solve this by setting assetsSubDirectory, assetsPublicPath, assetsRoot specifically for dev environment(and make webpack.dev.conf) to read from it, overwriting the base setting. It's kind of confusing that even in dev environment build system reads stuff from config.build.
Would it be better if these dev settings come with the teamplate? I can input a quick PR.
I met the same issue(file issue #103), and I modify the default configuraion to solve it.
@plantvsbirds I'd be open to taking a look at a PR with what you have in mind.
Haven't heard any reports of this problem for a while, so closing for now - happy to reopen pending new reports or _especially_ a proposed PR that would resolve it. 馃槃
Experienced same problem. Wanted to use output for an Apache Cordova app running on android. Had to change the assetsPublicPath from '/' to '' to get it running on android device. But when I did this, it would no longer work on dev server. The solution was to fix it like explained in issue #103 . Should the config support two different assetsPublicPaths out of the box?
@chrisvfritz: I've also run into this problem, and like @runarhk, I was able to fix it as explained by @rayzang8 in #103. The explanation there might not be a PR, but it's pretty close :)
In either case, this still seems to be a problem, and at least one of these tickets should be re-opened until it's resolved.
Actually I have a related issue.
I am completely fine developing in the root directory when in dev environment.
Problem arise when the production folder is in a sub (ex: www.site.com/event/party).
The biggest issue I have right now is the fonts.
The css are parsed with postcss (which is fine), but the utils.js that has the generateLoaders function kind of prevents me to easily add other plugins to postcss.
My goal was to use something like postcss-fontpath to fix the path issue.
In the current situation I can not have a relative path for my fonts. It's always relative to the root folder whatever I do.
Basically it would be great to have the possibility to have all assets relative to the current folder, or being able to specify the absolute path to set in prod environment. One or the other would solve my problem I think.
Anyone else with this kind of problem?
Most helpful comment
Actually I have a related issue.
I am completely fine developing in the root directory when in dev environment.
Problem arise when the production folder is in a sub (ex: www.site.com/event/party).
The biggest issue I have right now is the fonts.
The css are parsed with postcss (which is fine), but the
utils.jsthat has thegenerateLoadersfunction kind of prevents me to easily add other plugins to postcss.My goal was to use something like
postcss-fontpathto fix the path issue.In the current situation I can not have a relative path for my fonts. It's always relative to the root folder whatever I do.
Basically it would be great to have the possibility to have all assets relative to the current folder, or being able to specify the absolute path to set in prod environment. One or the other would solve my problem I think.
Anyone else with this kind of problem?