Just run and visit http://localhost:3000
npm run vanilla:serve
To build the App, run
npm run vanilla:build
You will see the generated files in dist folder that ready to be served.
- Create new folder in
src/pages
. - Create
index.html
. - Create
.css
and.ts
files if needed. - Add entry point in
vite.config.ts
(see an example below).
If you want to add cool
route take the following steps:
- Create
index.html
insidesrc/page/cool/
. - Add
resolve(root, 'cool', 'index.html')
toinput
array invite.config.ts
.
Now your vite.config.ts
should look like this:
// vite.config.ts
import { resolve } from 'path';
import { defineConfig } from 'vite';
const root = resolve(__dirname, 'src');
const outDir = resolve(__dirname, 'dist');
// https://vitejs.dev/config/
export default defineConfig({
root,
plugins: [],
build: {
outDir,
emptyOutDir: true,
rollupOptions: {
input: [
resolve(root, 'index.html'),
resolve(root, 'example', 'index.html'),
resolve(root, 'example', 'nested', 'index.html'),
resolve(root, 'cool', 'index.html')
]
}
}
});
You can remove/rename example routes. index.html
in src
folder is root file. It means, that your localhost:3000
will be represented by index.html
file.
You can read about linting on the wiki.
To manually run eslint
over your code, you can perform command in the terminal.
npm run vanilla:lint
To manually run stylelint
over your code, you can perform command in the terminal.
npm run vanilla:stylelint