vue-cli

dynamically setting __webpack_public_path__ does not work after build in vue application

北战南征 提交于 2021-02-10 21:12:03
问题 I have a vue frontend, and spring boot backend application. My application has multiple instances with different url paths (for example /instance1, /instance2), but uses the same build project - meaning every instances runs the same jar. Also the application serves static files - the index.html of the compiled vue application. My problem is that the vue application needs to know dynamically from which url path to get all its static files, so for example when i get the index.html of instance1

Command not found

我只是一个虾纸丫 提交于 2021-02-10 16:05:48
问题 Been struggling to get my first vue project started and was looking for some help. I have both npm and node updated on my system but continually keep falling to the same issue. My steps: 1.) npm install Terminal Response: npm WARN mbasile@1.0.0 No description up to date in 0.095s 2.) npm install vue Terminal Response: npm WARN mbasile@1.0.0 No description + vue@2.5.16 updated 1 package in 0.951s Here's where things get funky? 3.) npm install -g @vue/cli Terminal Response: npm ERR! path /Users

Why webpack converts require('path to img.png') in base64?

情到浓时终转凉″ 提交于 2021-02-10 14:38:48
问题 I have a chat, and a JSON file where all the history is stored. All images/video/audio link to require('path to media'). However, for some reason, when using vue-cli-service serve or vue-cli-service build, webpack skips my image which is used for Emoji, not including it in dist folder, but converting it to base64 string. JSON looks like this: { type: 'emoji', author: `me`, data: { src: require('../../Media/img/smiling-face.png') } }, { type: 'text', author: `me`, data: { text: `Do you read me

Is this possible to configure publicPath in vue-cli dynamically in runtime?

泄露秘密 提交于 2021-02-07 09:45:43
问题 Is this possible to change dynamically publicPath for vue application (in vue.config)? This means that I want to set public path be dynamically depends on real url(some domain), e.g. i want to make only one build, but use it for staging and prod env (and use different cdn-s for assets in different countries, etc). I find that webpack_public_path aims at setting at runtime the public path. But how can I use webpack_public_path with vueJS(vue-cli)? webpack_public_path - didn't work for me.

Vue-Cli: why after the build the index.html is not generated with quotes?

僤鯓⒐⒋嵵緔 提交于 2021-02-05 09:32:01
问题 After running the npm build, the ./dist/index.html file is generated without the quotes. The project does not have a webpack.config.js or a vue.config.js . The build is generated from the example project made with vue create . How do I solve this? <!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>html-project</title><link href=/app

Vue-Cli: why after the build the index.html is not generated with quotes?

╄→гoц情女王★ 提交于 2021-02-05 09:31:07
问题 After running the npm build, the ./dist/index.html file is generated without the quotes. The project does not have a webpack.config.js or a vue.config.js . The build is generated from the example project made with vue create . How do I solve this? <!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>html-project</title><link href=/app

Vue DOM image won't show correctly

丶灬走出姿态 提交于 2021-02-05 08:54:28
问题 I'm using the Vue framework and creating an image using the DomUtil.Create function. In this image I want to dynamically write the source to this image. But the image won't show to the user. I put a normal image on the page using the <img> tag and it works here. Only when creating the DOM element it doesn't work. I put the path hard coded in here so it is certain that the path is correct. var img = L.DomUtil.create("img", "popUpImg", divImg); img.src = '@/assets/pictures/1.png'; 回答1: Use

Using image src from asset variables

假如想象 提交于 2021-02-01 04:48:23
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <

Using image src from asset variables

浪子不回头ぞ 提交于 2021-02-01 04:46:50
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <

Using image src from asset variables

帅比萌擦擦* 提交于 2021-02-01 04:46:40
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <