Discover how to integrate Lovable with Visual Studio Code using our straightforward guide. Set up your environment to streamline coding and boost productivity.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
package.json
at the root of your Lovable project. This file will simulate dependency installation by listing the required packages.
{
"name": "lovable-project",
"version": "1.0.0",
"scripts": {
"build": "tsc",
"start": "node dist/app.js"
},
"devDependencies": {
"typescript": "^4.9.5" // Replace with the version you prefer
}
}
tsconfig.json
at the project root. This file sets up the TypeScript compiler options for your project.
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"esModuleInterop": true
},
"include": ["src/*/"],
"exclude": ["node_modules", "dist"]
}
src
folder are compiled into JavaScript in the dist
folder.
src
.src
folder, create a file called app.ts
. This will be your main TypeScript file.
// src/app.ts
console.log("Hello from your Lovable TypeScript project!");
.vscode
at the root of your project. Inside this folder, you will add configuration files for launching and building your project directly from Visual Studio Code.launch.json
in the .vscode
folder with the following content:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug TypeScript",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/dist/app.js",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
"${workspaceFolder}/dist/*/.js"
]
}
]
}
app.js
in the dist
folder) and to perform a build before starting the debug session.tasks.json
in the same .vscode
folder with the following content:
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": "build",
"label": "tsc: build - tsconfig.json"
}
]
}
tsc: build - tsconfig.json
when you start debugging.
F5
.tasks.json
to compile your TypeScript code and then launch the debugging session with the configuration set in launch.json
.dist
folder.When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.