vue files without NodeJS? vue files without NodeJS? vue.js vue.js

vue files without NodeJS?


  1. VueJS app is not NodeJS app.
  2. VueJS app is interpreted by the browser.
  3. You just have to build your app on computer and host files as any static website, so any server can serve html and files.
  4. To build your app use e.g. Webpack (https://github.com/vuejs-templates/webpack )


NodeJs only use to build *.js files in front-end, your WebApp dosen't have to run on Nodejs.

1, You can create a index.html file that requires *.js file when webpack built it.

2, Use Chrome to open your index.html file so you can see it works.

You don't need to use vue-cli or other servers if you only want a static page.

But you have to know how to set your webpack.config.js, you can look that doc https://webpack.js.org/guides/getting-started/


Your starting point is wrong. Vue + node.js can build a complete site. Vue is the front-end framework, node's server language. The two can be used in combination. But not vue must rely on node to use. The two of them can be perfect to achieve the front and back separation of the development model.

In projects that use vue, individuals do not recommend configuring webpack and vue-loader separately. You can directly use vue official scaffolding, vue-cli. Do not have to consider these configurations, automatically configured.

Vue-cli

If you just started learning Vue, here's an entry-level demo. Although it is only a small application, but it covers a lot of knowledge points (vue2.0 + vue-cli + vue-router + vuex + axios + mysql + express + pm2 + webpack), including front-end, back-end, database and other sites Some of the necessary elements, for me, learning great significance, would like to encourage each other!

Vue Demo