Search code examples
webpackvue.jsvuejs2bundlewebpack-2

What are the pros and cons of use webpack templates to create a vue project


I learned vue.js through a tutorial there, I learned to create a vue project using

vue init webpack-simple my-project

then install node modules and run using

npm run dev

Then I have found another way

vue create my-project

run using

npm run serve

Are there any other ways to create a vue project other than these two? Why we should / should not use web-pack templates to create vue projects?


Solution

  • You can also manually call vueJs like you'd call jquery without using a module bundler which should work fine.

    <script src="vue.js"></script>
    <script>
      // Your vue code
    </script>
    

    If you're building a complex application webpack helps you to easily manage you javascript files without having to call each file manually in your html.

    If your application is fairly small, and you don't have many static assets and you only need to build one Javascript file to serve to the client, then Webpack might be more than you need.