npm run watch
# or
yarn watch
# or
pnpm watch
To use the compiled code from dist in a webflow website.
npm run preview
# or
yarn preview
# or
pnpm preview
<link rel="stylesheet" href="http://localhost:4173/assets/index.css">
By bottom we mean before the closing body tag.
<script src="http://localhost:4173/assets/index.js"></script>
The port number here was taken from a M1 Mac device. If you are using windows or linux, the port number might be different. You can find the port number in the terminal where you ran the npm run preview
(described in step 2) command.
Vite by default removes all the console.log
statements from the code. If you want to keep them, you can do so in one of the following ways:
const { log } = console;
// or
window.console.log('Hello world');
You can use vercel
or cloudflare
pages to deploy the code. After deployment, you can use the preview url to link to your dist
folder assets.
In our .gitignore
, we are not ignoring the dist
folder. Which contains the compiled code.
So you can ignore the build step in your CI/CD pipeline. Since the dist folder is already present in the repository.
You dont need to run the build step in the CI/CD pipeline.