vue-cli | * 配置示例详解。目标为产出一套多场景适用脚手架 | Command Line Interface library
kandi X-RAY | vue-cli Summary
kandi X-RAY | vue-cli Summary
@vue/cli 4.0.* 配置示例详解。目标为产出一套多场景适用脚手架
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-cli
vue-cli Key Features
vue-cli Examples and Code Snippets
Community Discussions
Trending Discussions on vue-cli
QUESTION
I'm trying to decrease the bundle size of my Vue project, which scaffolded by the vue-cli, by using CDN of firebase, Vue, and Vuetify.
So, I've added links of these CDN in public/index.html
as follow:
ANSWER
Answered 2021-Jun-16 at 01:31If you are using vuetify from vue-cli-plugin-vuetify
(vue add vuetify
), treeshaking and auto component import is enabled by default, by using vuetify-loader
.
If you look into the source code of vue-cli-plugin-vuetify
, it only uses vuetify-loader
if it is present in your package.json
. So removing vuetify-loader
from package.json
should disable this behavior.
QUESTION
I´m currently working on a website using vue/cli 4.5.13 and firebase.
After trying to get a simple authentification site working, my npm run build fails with this message:
ERROR Failed to compile with 1 error
Syntax Error: TypeError: Cannot read property 'parseComponent' of undefined
You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file. ERROR Build failed with errors.
I know this problem was asked here frequently but all the given solutions didn´t work for me. So far i tried: npm install typescript@latest, npm uninstall @vue/component-compiler-utils, npm install --dev @vue/component-compiler-utils@3.1.2, npm update vue-template-compiler and npm audit fix (--force).
my package.json looks like this:
...ANSWER
Answered 2021-Jun-12 at 09:17Try to delete node modules directory and then run
QUESTION
I work with Vue3 in TS (last vue-cli).
I want to get all nodes (vnodes) elements when vue-loader compile .vue file. I need to read nodes attributes and remove all "data-test".
I have try in vue.config.js to use :
...ANSWER
Answered 2021-Jun-11 at 10:28The main problem here is that you are working with vue-template-compiler
documentation, but that package is the compiler for Vue 2!
In Vue 3, compiler is split into multiple packages and is missing proper documentation as of now (or I was just unable to find it)
Also there were significant changes in the API - instead of modules
, you pass nodeTransforms
(source) and transforms are not objects, just functions.
Luckily for you, there is a interesting video on YT presented by Vue core member Rahul Kadyan which shows the exact use case you need (removing data-test
attributes) - code
So I guess the code should look like this:
QUESTION
I'm using vue js 3, but im taking this error. I try to use router.
my main.js file is in here:
...ANSWER
Answered 2021-Jun-11 at 09:02First you've to follow my answer here to install the correct version of vue router,
then you should use the correct syntax of vue-router
4 which is compatible with vue 3 :
QUESTION
I am trying to setup a vue3 app with i18n localization. The localization is supposed to be located in json files. I added i18n via vue add i18n
to my project. The questions asked during installation were all answered with the default value except the one with the legacy support (my answer: no). When i try to use a text from a json file, it will tell me in the console [intlify] Not found 'message' key in 'en' locale messages.
The local translations work just fine.
And i have no clue why it is not working with the translations provided in the JSON file.
Here is my code:
packages.json
...ANSWER
Answered 2021-Jun-08 at 15:27The main probles is that the function in i18n.ts doing loadLocalMessages is not getting properly the files from the locales folder.
QUESTION
I am new to Vue js, I am building a website using Vue js where I have a home page and docs folder which contains a lot of documents written and save in a .md
file.
Now How I can on the navbar click redirect from my route.js page to docs .md
files. Below is my folder structure.
I want to serve my homepage from main.js which is created using vue.js, and docs
folder containing markdown files. Inside the docs
folder have .vuepress
with config.js
which was configured to load index.md as the home page.
ANSWER
Answered 2021-May-29 at 17:04You could add the the docs folder into the public
directory, then link to /docs/guide/...
QUESTION
ANSWER
Answered 2021-Jun-02 at 17:42I found out a solution to your problem. Follow below steps
At first Add box
class to every element that lies inside the box that toggle the dropdown
QUESTION
First of all, thank you for your help.
I'm currently writting a blog in vue.js with vuejs-cli and I'm stuck on a problem about the architecture of my blog.
What I want to do:
I want my vue.js app to fetch an article (which is a whole webpage with .html,.js,.css and pictures) in the subfolder of the "Articles" folder and then display it in a vue in two ways:
- like a preview (an image from the article and the article's title)
- by diplaying the full article
So I want the file tree to look like this:
...ANSWER
Answered 2021-Jun-02 at 07:26I finally made it works !
This is how I did it:
- I put my
Article
folder in thepublic
folder of vue-cli - Created a nodejs programme to make/update a database of all articles in the
article
folder every 10 minutes, sorting them by date of creation (I will make a cron job with cron later) - Made this nodejs programm to answer to some
GET
query:- when I want a preview, the programm send a "preview" of the article (it takes the title, the description and the first image of the html file of the
article
and send it in a html format) - when I want a url, the programm send the link of the html page inside the
public
folder (see how to do it here)
- when I want a preview, the programm send a "preview" of the article (it takes the title, the description and the first image of the html file of the
- So on my vuejs app, the view fetch a preview to the nodejs backend with the fetch api and show it. Then, when the user click on the preview, my vue show a
ifram
of the webpage's article at the specified url fetched.
Tips: Be aware that npm build
will erase the Article
's folder if it's only present in the dist folder. To avoid it, change the script of package.json
to add the --no-clean
argument to the build command
I don't know if it's a good and efficient way of doing it, but it works well and it's very easely customisable. So for the moment, I'll do it like that way :)
QUESTION
I have a directory called mock
at root which contains mocking data that I use to run the app in development mode. I would like to exclude them when i build for production. I notice that it is being added into bundle whenever i run vue-cli-service build
and it is bloating my app bundle size.
I am using vue-cli
and so I have to work with vue.config.js
.
It is not clear from the docs or any answers on the wider web how I can specify which folders/files to exclude from the build.
Here is a snippet of my vue.config.js
.
ANSWER
Answered 2021-Jun-01 at 14:47This is not the perfect solution, but...
If you want to exclude that directory at build time, you can try to use require instead
of import
. Something like this (source):
QUESTION
I'm trying to include a VLC video playing in my Electron app, which is possible through WebChimera.js. This package is distributed a bit weirdly (to me at least), to use it you need to require wcjs-prebuilt, specify some settings in package.json and configure Webpack to allow importing .node files as explained in this Wiki page for WebChimera.js.
However I believe this Wiki page is outdated, as loaders isn't a valid key anymore in a Webpack config. I'm not very experienced using Webpack so most of this is new to me. Also note that this Wiki explanation used a fork of node-loader, although this fork seems to be merged to the actual node-loader now (?).
I now use this Webpack config:
...ANSWER
Answered 2021-May-15 at 16:41I'm able to get vue electron building with wcjs-prebuilt
using a vue.config.js
like this. You will also need to set the VLC_PLUGIN_PATH
correctly or video won't play.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-cli
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page