Hi I'm developing a project and for some reasons I am not able to use any webpack and node modules. I also cannot use any cdn. The vue project will only contain client side components. I don't have to consider the backend part, routing etc. The size of the project matters so I am not allowed to use node modules. How can I create a client-side only vue project without node modules and npm?
-
The size of the project matters - how exactly? It seems that you have fundamental misunderstanding of JS toolchain. This shouldn't be a problem, unless you develop on a PC that has less that 1 Gb of free space and cannot handle NPM. 99.9...% node_modules there are needed for development and won't get to production. The size of node_modules says nothing about the size of a bundle that needs to be deployed to a server. Quite the opposite, often it's smaller than loading third-party libraries separately.Estus Flask– Estus Flask2020-10-13 09:35:45 +00:00Commented Oct 13, 2020 at 9:35
Add a comment
|
2 Answers
You can download Vue.js and use it locally in a project.
- Development version (with debug mode and all warnings).
- Production version (no warnings no debug)
After that you can just add it via a script tag:
<script src="your-vue-directory/vue.js"></script>
And you ready to go.
11 Comments
Yasin Demirkaya
So let's say I downloaded a free template from Vue's website without node module and I didn't use npm install command. The total size of the project will be 2-5 mb and that is basically what I want. Can I download the Vue.js in it and edit the template based on it?
S.Visser
Well that template probably has some dependencies, that is why it uses npm. Do you have an example of the template then I can have a look.
Yasin Demirkaya
creative-tim.com/product/… I thought I can use Vue's free admin panel or dashboard templates, there is live preview in the website you can display it or download it. The thing is according to edit these templates, I need node modules. I am searching for a way to get rid of node modules, cdn etc
S.Visser
So it uses chart.js, vue-i18n, vue-router, register-service-worker and vue2-transitions. I saw in your other comment that you want to use it to design a router portal. Why don't you just use npm and make a production build. This production build has all the dependencies gziped anyway, I can't imagine that it goes above 5mb. See cli.vuejs.org/guide/cli-service.html#using-the-binary for more information and how to check how large your build will be.
Yasin Demirkaya
So when I'm in development mode, I am allowed to design the Vue project by using node modules and when I finished the project and built it for production, I will no longer need node modules?
|
According to docs you can use CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
2 Comments
Yasin Demirkaya
I will design a dashboard for a router or a modem so I am not allowed to use CDN because the clients will not be able to connect the internet so Vue needs to embedded in some way.
l2ysho
still you can download a content of CDN and use it locally