{"id":50,"date":"2022-01-01T12:00:00","date_gmt":"2022-01-01T12:00:00","guid":{"rendered":"http:\/\/frontendguruji.com\/?p=50"},"modified":"2022-07-01T20:06:25","modified_gmt":"2022-07-01T20:06:25","slug":"how-to-setup-a-vue-js-project-without-cli","status":"publish","type":"post","link":"https:\/\/frontendguruji.com\/blog\/how-to-setup-a-vue-js-project-without-cli\/","title":{"rendered":"How to setup a Vue JS project without CLI [Best way to learn Vue environment][Including SFC&#8217;s &#038; Vue Router v4]"},"content":{"rendered":"\n<p id=\"block-f0612dc8-ceec-438c-9b08-e091830c43d8\">Hello Friends! &#x1f64f;. Today we will<strong> setup Vue Js project without CLI<\/strong> and this is the <strong>best way to learn Vue 3 project environment<\/strong>. <\/p>\n\n\n\n<p id=\"block-f0612dc8-ceec-438c-9b08-e091830c43d8\">Vue CLI provides a <a href=\"https:\/\/cli.vuejs.org\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">command<\/a>, that can setup Vue JS project easily, most of the developers use it for saving time &#x23f3; &amp; offcourse saving brain &#x1f9e0; too &#x1f601; but they skip most of the important things used behind the scenes to build a project and later when they are told to do any changes in the setup, they had no idea about the same &#x1f62f;.<\/p>\n\n\n\n<p id=\"block-6ad3a9a6-e8b5-441a-b8b0-f33d793e386a\">So to help understanding behind the scene technologies, in this <strong>Vue JS tutorial<\/strong>, we will <strong>setup Vue 3 with Webpack, from scratch, without using Vue CLI<\/strong>&#x1f60e;. And while doing that, we will explore all dependencies needed to setup vue 3 with Webpack.<\/p>\n\n\n\n<p id=\"block-f2ba7f30-4e4e-4907-baab-7e88f7bdc142\"><strong>Chalo suru kiya jaye!<\/strong>&#x1f37b;<strong> Lets start! <\/strong>&#x1f57a;<\/p>\n\n\n\n<h2>Step 1: Install\/Upgrade\/Verify Node<\/h2>\n\n\n\n<p>To start with setup Vue 3 project, first please verify if your machine has node v &gt;= 14 &amp; npm v &gt;=5.6.<br>If not, then <a rel=\"noreferrer noopener\" href=\"https:\/\/nodejs.org\/en\/\" target=\"_blank\">install node package here<\/a>.<\/p>\n\n\n\n<p>While upgrading node package on my machine to latest version: 16.13.1 which includes npm 8.1.2, I faced one issue, may be you also get this type of error, check here to resolve it: <a rel=\"noreferrer noopener\" href=\"http:\/\/frontendguruji.com\/warn-npm-does-not-support-node-js-v16-13-1\/\" target=\"_blank\">WARN npm does not support Node.js v16.13.1<\/a><\/p>\n\n\n\n<h2 id=\"block-31a78271-de46-416b-bd1e-18504848236e\">Step 2: Initialize a folder<\/h2>\n\n\n\n<p id=\"block-ae9faf0f-1673-40fa-81fa-7861d5aad818\">So friends! first thing we have to do is to create a blank folder &#x1f4c1; &amp; initialize it using below command<\/p>\n\n\n\n<pre id=\"block-dcb203ca-c08f-4c5e-a1d7-efd1f19adaad\" class=\"wp-block-code\"><code>npm init<\/code><\/pre>\n\n\n\n<p id=\"block-84dfbe02-e7e4-42d2-bcdc-fbe05f384481\">This command will run a wizard of questions\/choices related to the project &amp; we have to answer\/select them. This basically creates a <strong>package.json<\/strong> file which will include all our answers\/selections.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img width=\"791\" height=\"749\" src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2021\/12\/image-15.png\" alt=\"vue js project without cli, setup vue 3 with webpack,best way to learn vue 3,setup vue 3 project,vue js tutorial\" class=\"wp-image-136\" srcset=\"https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2021\/12\/image-15.png 791w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2021\/12\/image-15-300x284.png 300w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2021\/12\/image-15-768x727.png 768w\" sizes=\"(max-width: 791px) 100vw, 791px\" \/><\/figure>\n\n\n\n<h2 id=\"block-c1455b78-d936-40a0-912d-20aca5e67828\">Step 3: Setup Vue JS  Project without CLI &#8211; Adding Dependencies<\/h2>\n\n\n\n<h3 id=\"block-c7063e58-5cc6-4f10-a291-c326664005d0\">Adding Vue 3<\/h3>\n\n\n\n<p id=\"block-d9548a96-fd83-4a2b-8b7e-c6db0fecf165\">To use <strong>Vue JS v3<\/strong> we need core <strong>vue <\/strong>package that contains the functionality needed to define Vue components.<\/p>\n\n\n\n<p>As we have installed the latest<strong> vue-router@4 <\/strong>&nbsp;package i.e. v4, there are many breaking changes. So better read the <a rel=\"noreferrer noopener\" href=\"https:\/\/next.router.vuejs.org\/guide\/migration\/\" target=\"_blank\">v4 documentation<\/a> before diving into it.<\/p>\n\n\n\n<pre id=\"block-95695356-ec26-4a0d-8e37-0940e53033a5\" class=\"wp-block-code\"><code>npm install vue@next vue-router@4<\/code><\/pre>\n\n\n\n<p> <strong>vue\/compiler-sfc <\/strong>is Vue JS compiler and used to convert our Vue files into JavaScript. <strong>Needed for Single File Components (SFCs)<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install --save-dev @vue\/compiler-sfc<\/code><\/pre>\n\n\n\n<h3 id=\"block-ce369162-7e30-47ad-b10e-c182b7d51930\">Adding Babel &#8211; JS Compiler<\/h3>\n\n\n\n<p id=\"block-2f6a1a37-d70a-4707-bab4-0930e03133f4\">Babel is a compiler which converts ES6 code to ES5 code, so that older browser can also run the application.<br>So basically It lets us write modern JavaScript code that still works in older browsers.<\/p>\n\n\n\n<pre id=\"block-d58778dc-6bf5-4df3-840c-71355b9802de\" class=\"wp-block-code\"><code>npm install --save-dev @babel\/core @babel\/preset-env<\/code><\/pre>\n\n\n\n<p id=\"block-5cca8528-5075-4477-bc8c-9dcb872133b1\"><strong>babel\/core<\/strong> contains the main babel functionality i.e. converting the modern JS to ES5.<br><strong>babel\/preset-env<\/strong> this is helpful for multiple syntax transforms\/browser polyfills that are needed by the target environment\/browsers.<\/p>\n\n\n\n<h3 id=\"block-afc98429-e9b3-4bec-9595-1efc69ef8b73\">Adding Webpack &#8211; Bundler<\/h3>\n\n\n\n<p id=\"block-a8df6131-c898-4547-9a9b-febb97a65f9e\">Webpack is a bundler for modern JS projects, this basically combines all the modules used in the project to one or multiple bundles<\/p>\n\n\n\n<pre id=\"block-881b5e3b-c953-408b-904b-98d1f7ec641e\" class=\"wp-block-code\"><code>npm install --save-dev webpack webpack-cli webpack-dev-server<\/code><\/pre>\n\n\n\n<p id=\"block-53597a0b-7cd7-4074-acb3-d09a7bcce0d6\"><strong>webpack <\/strong>contains the core functionality and<strong> webpack-cli<\/strong> is to run webpack from command line.<br><strong>webpack-dev-server<\/strong> is to view projet in browser locally while development.<\/p>\n\n\n\n<p id=\"block-b2da8818-f0d7-4ebd-9616-db4d036e8067\">By default Webpack process only JS files and to process other assest like images, CSS &amp; HTML it requires loaders, below are some basic loaders:<\/p>\n\n\n\n<pre id=\"block-8068b05c-bfd1-4e9e-b6de-690fcd529469\" class=\"wp-block-code\"><code>npm install --save-dev babel-loader vue-loader@next html-loader css-loader vue-style-loader\n<\/code><\/pre>\n\n\n\n<p id=\"block-e51c2745-9303-4dc4-93e3-2cdb9c861a06\"><strong>babel-loader<\/strong>: loader for babel files<br><strong>html-loader<\/strong>: loader for HTML files<br><strong>vue-loader@next<\/strong>: loader to author <strong>Vue v3 <\/strong>components in a <strong>Single-File Components (SFCs) format <\/strong><br><strong>css-loader<\/strong>: loader for CSS files<br><strong>vue-style-loader<\/strong>: it similar to webpack style-loader and dynamically inject CSS into the document as style tags and used by default in vue-loader, <strong>needed for Single File Components (SFCs)<\/strong><\/p>\n\n\n\n<p id=\"block-7639a162-458d-4398-b279-4092bc4c5370\"><em>Optional<\/em>: To use CSS preprocessors like <strong>SCSS<\/strong>, you will have to install <strong>sass-loader <\/strong>&amp; <strong>sass<\/strong>.<\/p>\n\n\n\n<pre id=\"block-bda8735e-6abe-444e-8f5a-772a613435a7\" class=\"wp-block-code\"><code>npm install --save-dev sass-loader sass<\/code><\/pre>\n\n\n\n<p id=\"block-9c864567-105e-498a-8b7a-ead8eacf44ff\">By default Webpack bundles CSS into JS, to generate seperate CSS file, you will have to install <strong>mini-css-extract-plugin<\/strong><\/p>\n\n\n\n<pre id=\"block-3a444935-dfbe-427f-b1a0-abf6828b8bbc\" class=\"wp-block-code\"><code>npm install --save-dev mini-css-extract-plugin<br>\ufeff<\/code><\/pre>\n\n\n\n<p id=\"block-a86df485-5b74-4186-adb7-e7765245935c\">Now we need a HTML page to inject all the files\/bundles generated by Webpack. For that we need to add <strong>html-webpack-plugin<\/strong>.<\/p>\n\n\n\n<pre id=\"block-5eea0adb-016e-4938-b2c4-e262aba6e0e6\" class=\"wp-block-code\"><code>npm install --save-dev html-webpack-plugin<\/code><\/pre>\n\n\n\n<p id=\"block-4df35100-c7b0-4622-8ed8-77e3422f769b\">Now our <strong>package.json<\/strong> file looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img width=\"653\" height=\"658\" src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2022\/01\/image-3.png\" alt=\"vue js project without cli, setup vue 3 with webpack,best way to learn vue 3,setup vue 3 project,vue js tutorial\" class=\"wp-image-178\" srcset=\"https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-3.png 653w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-3-298x300.png 298w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-3-150x150.png 150w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/figure>\n\n\n\n<p id=\"block-a9317b96-71a1-4d6e-98a3-5123e6d60d7b\">That&#8217;s all in the dependencies &#x1f605;, lets jump to create an App then some configurations and then will try to run it &#x1f57a;.<\/p>\n\n\n\n<h2 id=\"block-2a6dd0d7-1a72-4589-acbd-3a45f37aa0cb\">Step 4: Creating &#8216;Hello World&#8217; Vue App<\/h2>\n\n\n\n<p id=\"block-026221a3-c3cd-4180-942a-f46c50c7a8de\">Create <strong>src <\/strong>folder&#x1f4c1; and then create a component <strong>App.vue<\/strong> in it, here we are using <strong>Single File Components<\/strong> (SFCs).<\/p>\n\n\n\n<p>This means we will be declaring <strong>template<\/strong>, <strong>styles <\/strong>and <strong>script <\/strong>in the same file.  <\/p>\n\n\n\n<pre id=\"block-a1ff1cde-cc5b-47db-aeee-af7e14b8eab7\" class=\"wp-block-code\"><code>\/\/ <strong>sr\/App.vue<\/strong>\n&lt;<strong>script<\/strong>&gt;\nexport default {\n  data() {\n    return {\n      greeting: \"Hello, World!\",\n    };\n  },\n};\n&lt;\/script&gt;\n\n&lt;<strong>template<\/strong>&gt;\n  &lt;div class=\"message\"&gt;{{ greeting }}&lt;\/div&gt;\n&lt;\/template&gt;\n\n&lt;<strong>style <\/strong>lang=\"<strong>scss<\/strong>\"&gt;\n@import \".\/styles.scss\";\n&lt;\/style&gt;\n<\/code><\/pre>\n\n\n\n<p id=\"block-be1918eb-ce57-4278-84fc-830ed63b3301\">Now create a style for the App component <strong>styles.scss<\/strong>.<\/p>\n\n\n\n<pre id=\"block-ca504497-3c35-478a-bd6e-6efb31fe60a7\" class=\"wp-block-code\"><code>\/\/ <strong>src\/styles.scss<\/strong><br>.message {<br>    text-align: center;<br>    font-size: 30px;<br>}<\/code><\/pre>\n\n\n\n<p id=\"block-653802e0-8c07-4ddd-8371-546962b4cfee\">Now we need to create the main entry file (<strong>index.js<\/strong>) which will render the app in a DOM element having id=&#8221;<strong>root<\/strong>&#8220;, this element we will create later in this tutorial.<\/p>\n\n\n\n<p>Here <strong>vue-router<\/strong> will be handling the application routes.<br>createRouter method requires history and routes array. Here we have:<br><strong>Hash history mode<\/strong> is created with <strong>createWebHashHistory()<\/strong>: It uses a hash character (#) in URL, which is not good for SEO.<br><strong>HTML5 history <\/strong>mode is created with<strong> createWebHistory()<\/strong>: It uses normal url and this is the <strong>recommended one.<\/strong><\/p>\n\n\n\n<pre id=\"block-e08546c0-105c-48e7-9f81-b18d72150a2a\" class=\"wp-block-code\"><code><strong>\/\/ src\/index.js<\/strong>\nimport * as Vue from \"vue\";\nimport * as VueRouter from <strong>\"vue-router<\/strong>\";\nimport App from \".\/App.vue\";\n\nconst routes = &#91;{ path: \"\/\", component: App }];\nconst router =<strong> VueRouter.createRouter<\/strong>({\n  routes,\n  history:<strong> VueRouter.createWebHistory()<\/strong>,\n});\n\nconst app = Vue.<strong>createApp<\/strong>(App);\n<strong>app.use(router)<\/strong>;\napp.mount(\"<strong>#root<\/strong>\");\n<\/code><\/pre>\n\n\n\n<h2 id=\"block-9edaa1b5-ba72-46db-acf2-f4a477a67ed5\">Step 5: Configure Webpack<\/h2>\n\n\n\n<p id=\"block-3d18bcf6-a529-43ba-8970-d82e294796fd\">Now we will have to configure webpack, webpack-dev-server, loaders and plugins that we installed above &#x1f605;, lets start!<\/p>\n\n\n\n<p id=\"block-37701369-aa44-4d1c-bbba-0de712a84cc3\">Create a blank webpack configuration file <strong>webpack.config.js<\/strong> in the root folder and start adding the below configurations.<\/p>\n\n\n\n<p id=\"block-2136bfce-3f34-4683-9298-cc23efcb7b71\">Below is the main <strong>configuration for webpack<\/strong>, here you have to give the <strong>entry<\/strong> point of the file (<em>index.js<\/em> in our case) and <strong>output <\/strong>path for the generated bundles (<em>dist <\/em>in our case). Empty configurations like devServer, rules, plugins will configure one by one below.<\/p>\n\n\n\n<pre id=\"block-6c1bc199-de34-4160-907a-28fe5c05ed8d\" class=\"wp-block-code\"><code>\/\/ \/<strong>webpack.config.js<\/strong><br>\/\/ imports<br>const path = require('path');<br><br>\/\/ module<br>module.exports = {<br>  mode: 'development',<br>  <strong>entry<\/strong>: '.\/src\/<strong>index.js<\/strong>',<br>  <strong>output<\/strong>: {<br>    path: path.resolve(__dirname, '<strong>dist<\/strong>')<br>  },<br>  devServer: {},<br>  rules: &#91;],<br>  plugins: &#91;]<br>};<\/code><\/pre>\n\n\n\n<p id=\"block-22a2d89a-8a74-4fc7-b2e7-a09e24ce42e8\">Now we will configure <strong>loaders<\/strong> in module <strong>rules: [] <\/strong>defined above<\/p>\n\n\n\n<h3 id=\"block-508941df-de16-4fee-addd-f18748cbb5c9\">Configure <strong>SCSS<\/strong>.<\/h3>\n\n\n\n<p id=\"block-508941df-de16-4fee-addd-f18748cbb5c9\"><em>Note: Loaders are evaluated\/executed from bottom to top.<\/em><br>Here execution starts with sass-loader, continues with css-loader and finally ends with style-loader.<\/p>\n\n\n\n<pre id=\"block-a9374b3a-a95a-4a8f-a760-68f6a7106ff8\" class=\"wp-block-code\"><code>{<br>  test:\/\\.scss$\/,<br>  use: &#91;{<br>      loader: 'style-loader'<br>    },<br>    {<br>      loader: 'css-loader'<br>    },<br>    {<br>      loader: 'sass-loader'<br>    }<br>  ]<br>}<\/code><\/pre>\n\n\n\n<h3>Configure <strong>vue-loader<\/strong> <\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  test: \/\\.vue$\/i,\n  exclude: \/(node_modules)\/,\n  use: {\n    loader: \"vue-loader\",\n  },\n}<\/code><\/pre>\n\n\n\n<h3>Configure <strong>Babel<\/strong><\/h3>\n\n\n\n<p id=\"block-5f57c5c2-4db3-4961-b4e1-b00eaa1f5e75\"><strong>babel-loader<\/strong> configuration.<br><strong>options.preset<\/strong> will tell babel to use these presets while compiling the code.<\/p>\n\n\n\n<pre id=\"block-b0218266-b4f0-47a7-b38a-846f78e1220e\" class=\"wp-block-code\"><code>{\n  test: \/\\.(js|jsx)$\/,\n  exclude: \/(node_modules)\/,\n  use: {\n    loader: 'babel-loader',\n    options: {\n      presets: &#91;\"@babel\/preset-env\"],\n    },\n  }\n}<\/code><\/pre>\n\n\n\n<h3 id=\"block-7aa5dc67-8fb1-4560-a719-3db4258a0aa9\">Configure <strong>html-loader<\/strong><\/h3>\n\n\n\n<pre id=\"block-fa6002e5-20da-44b1-9272-5236ac392f23\" class=\"wp-block-code\"><code>{<br>  test: \/\\.html$\/i,<br>  loader: \"html-loader\",<br>}<\/code><\/pre>\n\n\n\n<h3 id=\"block-ce2589eb-d4f0-411c-b653-6ea6946665eb\">Configure <strong>plugins<\/strong><\/h3>\n\n\n\n<p id=\"block-95fea288-b873-4eba-b19b-724e491f028e\"><strong>mini-css-extract-plugin<\/strong> will extract the styles.css from bundle and generates a seperate file.<br><strong>html-webpack-plugin<\/strong> will create html file at <strong>dist\/index.html<\/strong> and will automatically inject all the webpack generated files along with the CSS gerenated by mini-css-extract-plugin.<\/p>\n\n\n\n<pre id=\"block-9cda7ead-18fb-4ded-9088-f97b9f653365\" class=\"wp-block-code\"><code>\/\/ <strong>add in imports<\/strong>\nconst MiniCssExtractPlugin = require(\"mini-css-extract-plugin\");\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst { VueLoaderPlugin } = require(\"vue-loader\");\n\n\/\/ <strong>add in plugins array<\/strong>\nnew VueLoaderPlugin(),\nnew MiniCssExtractPlugin(),\nnew HtmlWebpackPlugin({\n  template:\"<strong>.\/src\/index.html<\/strong>\"\n})\n\n\/\/ <strong>add in rules array<\/strong>\n{\n  test: \/\\.css$\/i,\n  use: &#91;MiniCssExtractPlugin.loader, \"css-loader\"],\n},<\/code><\/pre>\n\n\n\n<p id=\"block-c77a5ec9-7d63-4ca6-a500-7597de1ac7f3\">for <strong>html-webpack-plugin<\/strong> we need to create a html template which will be used by this plugin to inject the scripts &amp; styles generated by webpack. For tha create <strong>index.html<\/strong> file inside src folder &#x1f4c1;. This html will contain the element having id=&#8221;<strong>root<\/strong>&#8220;, this will be the element where app will load.<\/p>\n\n\n\n<pre id=\"block-d78470c0-2147-4a58-9497-5bb232baffd2\" class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;<br>&lt;html lang=\"en\"&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=\"UTF-8\" \/&gt;<br>    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" \/&gt;<br>    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/&gt;<br>    &lt;title&gt;Hello World App&lt;\/title&gt;<br>  &lt;\/head&gt;<br>  &lt;body&gt;<br>    &lt;div id=\"<strong>root<\/strong>\"&gt;&lt;\/div&gt;<br>  &lt;\/body&gt;<br>&lt;\/html&gt;<br>\ufeff<\/code><\/pre>\n\n\n\n<h3 id=\"block-4a490e70-f75c-4596-b97f-d868f4bf62c3\">Configure <strong>webpack-dev-server<\/strong>.<\/h3>\n\n\n\n<p id=\"block-4a490e70-f75c-4596-b97f-d868f4bf62c3\">It needs <em>directory <\/em>which must be path to the <strong>dist <\/strong>folder and a <em>port <\/em>to run on. If you want webpack to open the App in browser automatically provide <strong>open: true<\/strong>.<\/p>\n\n\n\n<pre id=\"block-bab2d5f0-e70f-4d21-b2fc-56ac7b926354\" class=\"wp-block-code\"><code>devServer: {<br>  static: {<br>    <strong>directory<\/strong>: path.join(__dirname, 'dist'),<br>  },<br>  <strong>port<\/strong>: 9000,<br>  open: true<br>}<\/code><\/pre>\n\n\n\n<p id=\"block-9fc148a1-84ce-41f8-acca-b025c1529300\"><a href=\"https:\/\/github.com\/mandeeppasbola\/setup-vuejs-project-without-vue-cli\/blob\/main\/webpack.config.js\" target=\"_blank\" rel=\"noreferrer noopener\">Check here the final <strong>webpack.config.js<\/strong> file.<\/a><\/p>\n\n\n\n<h2 id=\"block-7a64b213-d3fa-4482-8759-eb4a7425cf60\">Step 6: Adding build commands<\/h2>\n\n\n\n<p id=\"block-82a17693-26bf-431f-9893-bb9d88fe0150\">To build or run the project we will have to add some commands in package.json file under scripts property.<\/p>\n\n\n\n<pre id=\"block-9a1bc971-f60a-4f23-8baa-17098cf827d6\" class=\"wp-block-code\"><code>\"scripts\": {<br>  \"start\": \"webpack-dev-server\",<br>  \"build\": \"webpack\"<br>}<\/code><\/pre>\n\n\n\n<p id=\"block-60ab7bca-0c12-4c27-b360-1733a4212616\"><strong>start <\/strong>command will execute webpack-dev-server which will build the project <em>in memory<\/em> and load the page on the browser.<br><strong>build<\/strong> command will build the project in <em>dist <\/em>folder with all the files.<\/p>\n\n\n\n<p id=\"block-1af2f1ee-b399-4771-8342-2a3194f899f7\"><a href=\"https:\/\/github.com\/mandeeppasbola\/setup-vuejs-project-without-vue-cli\/blob\/main\/package.json\" target=\"_blank\" rel=\"noreferrer noopener\">Check here the final <strong>package.json<\/strong> file.<\/a><\/p>\n\n\n\n<p id=\"block-de39a887-9b1b-4d94-a355-74ad104d9fbe\">Now the final moment&#x1f605; &#x1f973;&#x1f973;<\/p>\n\n\n\n<pre id=\"block-d3e798e5-a4cd-43a3-acd5-c08ea8fdfb8d\" class=\"wp-block-code\"><code>npm run start \/\/ to start the app in browser<br>npm run build \/\/ to generate the dist folder with files<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"block-9804fb83-69a1-435b-866e-9bb0fdf221cf\"><img src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2021\/12\/image-14.png\" alt=\"vue js project without cli, setup vue 3 with webpack,best way to learn vue 3,setup vue 3 project,vue js tutorial\"\/><\/figure>\n\n\n\n<p>And in source view, you can see the injected JS and Style file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img width=\"714\" height=\"285\" src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2021\/12\/image-20.png\" alt=\"vue js project without cli, setup vue 3 with webpack,best way to learn vue 3,setup vue 3 project,vue js tutorial\" class=\"wp-image-150\" srcset=\"https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2021\/12\/image-20.png 714w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2021\/12\/image-20-300x120.png 300w\" sizes=\"(max-width: 714px) 100vw, 714px\" \/><\/figure>\n\n\n\n<p>&#x1f449;<a href=\"https:\/\/github.com\/mandeeppasbola\/setup-vuejs-project-without-vue-cli\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Checkout the project here. <\/strong><\/a><\/p>\n\n\n\n<p>Thats all in this <strong>Vue JS tutorial<\/strong>, here we learned how to <strong>setup Vue 3 project from scratch without  using Vue CLI<\/strong> and also learned how to <strong>configure webpack<\/strong>, <strong>configure babel<\/strong>, <strong>configure Webpack loaders and plugins<\/strong>, <strong>added build commands<\/strong>. <\/p>\n\n\n\n<p>&#x2753;If you have any question or suggestion, please feel free to comment. <\/p>\n\n\n\n<p>Thanks&#x1f64f;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Vue JS tutorial, you will learn how to setup vue js project without cli, this is the best way to learn vue 3 environment.We will setup vue 3 with webpack and will configure babel, Webpack loaders and plugins and add build commands.<\/p>\n","protected":false},"author":1,"featured_media":187,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[8],"tags":[29,21,12,18,7,43,35,37,44,9,41,42,45,23,36],"_links":{"self":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/posts\/50"}],"collection":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":0,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/media\/187"}],"wp:attachment":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}