[英]Vue custom (cli ?) project generator
All my VueJS projects use at the beginning the same baseline :我所有的 VueJS 项目一开始都使用相同的基线:
Plus, all my projects have quite the same "index.js" file.另外,我所有的项目都有完全相同的“index.js”文件。
Is there a way to have a command line (preferably based on Vue CLI) that can generate a project with a pre-coded "index.js" file and a package.json with those above dependencies ?有没有办法让命令行(最好基于 Vue CLI)生成一个带有预编码“index.js”文件和具有上述依赖项的 package.json 的项目?
It sounds like you are wanting to use the Vue CLI to create a project.听起来您想使用Vue CLI创建一个项目。 However, you additionally want some default npm packages to be installed and imported into your
index.js
file.但是,您还需要安装一些默认的 npm 包并将其导入到您的
index.js
文件中。
Answer: no.回答:没有。 this functionality does not exist (currently)
此功能不存在(当前)
Some Suggestions:一些建议:
I think the easiest route is to just create an empty vue project how you want it.我认为最简单的方法是按照你想要的方式创建一个空的 vue 项目。 Save that repo as 'vue-boilerplate' or something and just always start off with that empty project opposed to doing
vue create
every time.将该存储库另存为“vue-boilerplate”或其他内容,然后始终从该空项目开始,而不是每次都执行
vue create
。
In my personal opinion, I think going through all this to npm install 3 packages and add the imports to a js file isn't entirely worth it unless you find yourself creating a massive amount of projects that will all require the exact same setup.在我个人看来,我认为通过 npm install 3 个包并将导入添加到 js 文件中并不完全值得,除非您发现自己创建了大量需要完全相同设置的项目。
Angular has a similar idea called schematics but I do not see an equivilant within Vue as of yet. Angular 有一个类似的想法,称为原理图,但我在 Vue 中还没有看到等价物。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.