Before now, it was impossible to configure a Vue.js application using Deno. But now, that’s changed recently, thanks to the introduction of vno.
In this article, I’ll explain what vno is, the powerful features it offers, how to install Deno, and how to configure a new Vue app using vno.
According to one of vno’s creators, Andrew Rehrig, “Vno is a parser, compiler, and bundler and can be easily accessed through an integrated CLI tool that will either create an entire project from scratch, including an example file structure and components or optimize an existing Vue project with a few simple commands.”
Unlike Vue CLI, which uses Node.js and its packages (Node modules) to configure and bundle your Vue application, vno sets to bring this same experience of Vue CLI to Deno.
Don’t know what Deno is? Check out this friendly introduction.
This tutorial assumes the following prerequisites:
The first required step is to install Deno, and we can do this easily with scoop by running:
scoop install deno
Once this is completed, run deno -V
. If the installation was successful, you should see the version of Deno you’d put into your console/command line, like below:
Note: Installing vno requires Deno version 1.7 or above. If you’ve installed a former version of Deno, you can update to the latest version by running:
deno upgrade
The latest stable version of vno by can be installed by running:
deno install --allow-net --unstable -f -n vno https://deno.land/x/vno/install/vno.ts
Once this process is completed, you should see an output asking you to add .deno\bin
to PATH
, along with the command to do so (this command varies, depending on your device operating system). To do this on a Windows system, run:
set PATH=%PATH%;C:\Users\<PC-Username>\.deno\bin
Similar to Vue CLI, creating a new application is as easy as running:
vno create new-app
Once this process is completed, let’s CD into our new app directory and serve the app:
cd new-app vno run dev
You should see something like this:
After visiting http://localhost:3000, you should see the following page rendered on your browser:
vno run dev
or vno build
commandApp.vue
file serves as your app entry point.Building your vno app is simple and fast. First, run the following command:
vno build
This command will generate a new vno-build folder, which would usually contain a build.js
and style.css
file.
Once these files are generated, create a new index.html file that links the build.js
and style.css
together, like below:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" /> <link rel="stylesheet" href="./style.css" /> <title>your project</title> </head> <body> <div id="app"> <!-- built files will be auto injected --> </div> <script type="module" src="./build.js"></script> </body> </html>
Now that the build files are linked together, you can go ahead to run the index.html file. You should see the same output as when we were running our app via the dev server.
When you run the vno build
command, vno recursively walks through your file structure, locates all .vue files, and begins the parsing process. During this process, individual components are isolated and saved, and all necessary connections between each file are accounted for so that any error that might occur during the build process will be in proper order.
It is also possible to integrate vno in your application without installing the vno CLI.
You can import vno into your application with a URL like:
import { Factory } from 'https://deno.land/x/vno/dist/mod.ts'; const vno = new Factory(); await vno.build();
If you have your vno.config.js file already set up, the API will automatically search for it and apply it to your application. But without a vno.config.js file, you can input the object directly into the Factory instance, like below:
import { Factory } from 'https://deno.land/x/vno/dist/mod.ts'; const vno = Factory.create({ root: "App", entry: "./" vue: 3, options: { port: 3000 } }) await vno.build();
The vno.build() method is the same as the vno build command, as it will also perform a build on the entire application and compile it to a vno-build directory as one javascript file and one CSS file.
In this article, I introduced you to the world of vno and Deno and showed you how to scaffold a new Vue application using vno.
Debugging Vue.js applications can be difficult, especially when there are dozens, if not hundreds of mutations during a user session. If you’re interested in monitoring and tracking Vue mutations for all of your users in production, try LogRocket.
LogRocket is like a DVR for web and mobile apps, recording literally everything that happens in your Vue apps, including network requests, JavaScript errors, performance problems, and much more. Instead of guessing why problems happen, you can aggregate and report on what state your application was in when an issue occurred.
The LogRocket Vuex plugin logs Vuex mutations to the LogRocket console, giving you context around what led to an error and what state the application was in when an issue occurred.
Modernize how you debug your Vue apps — start monitoring for free.
Hey there, want to help make our blog better?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up nowThe useReducer React Hook is a good alternative to tools like Redux, Recoil, or MobX.
Node.js v22.5.0 introduced a native SQLite module, which is is similar to what other JavaScript runtimes like Deno and Bun already have.
Understanding and supporting pinch, text, and browser zoom significantly enhances the user experience. Let’s explore a few ways to do so.
Playwright is a popular framework for automating and testing web applications across multiple browsers in JavaScript, Python, Java, and C#. […]