-
Notifications
You must be signed in to change notification settings - Fork 4.4k
npm run build asset path incorrect #1266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not 100% sure I understand your issue, but;
that's the expoected behaviour if you leave the default setting for the assetsPublicPath``in It's an absolute path, and this behaviour is intended - it's required for vue-router to work correctly in history mode. You can change the |
assetsPublicPath = '' fixed my problem but what about importing font awesome using this import statement and running npm run build import './assets/font-awesome-4.7.0/css/font-awesome.css' final output no idea why static is repeating ? it should be just |
Hm, In guess the hardcoded import for the font in fontawesome is messing something up. Won'T have much time to look into this in the coming days, sorry. |
Try chaging this line: to this: name: NODE_ENV === 'production'
? utils.assetsPath('../../fonts/[name].[hash:7].[ext]')
: utils.assetsPath('fonts/[name].[hash:7].[ext]') |
@LinusBorg How can we do this with latest Vue (vue-cli 3)? |
You don't have to, it should work. Ask question on forum.vuejs.org please. |
@LinusBorg it does not work. generated |
|
webpack template static path on build prod should be fixed... all the assets are currently build as src=static/js/..... which on windows os or xampp apache is undefined path unless i change all to ./static/js/ ....
root path : http://localhost/prodbuild/
static path on npm run build : static/[js/css]/....
in which the browser is assuming the assets are on http://localhost/static/[js/css/]/... instead of http://localhost/prodbuild/static/[js/css]/...
thanks
The text was updated successfully, but these errors were encountered: