-
- scaffold
- lint
- format
- test
-
- dev server
- build command
-
- SCSS watcher with autoprefixer
npm i
<script type="module">
import 'my-element-openwc-vitejs/my-element-openwc-vitejs.js';
</script>
<my-element-openwc-vitejs></my-element-openwc-vitejs>
To scan the project for linting and formatting errors, run
npm run lint
To automatically fix linting and formatting errors, run
npm run format
To execute a single test run:
npm run test
To run the tests in interactive watch mode run:
npm run test:watch
For most of the tools, the configuration is in the package.json
to minimize the amount of files in your project.
If you customize the configuration a lot, you can consider moving them to individual files.
npm run vite
npm run vite-build
SCSS watcher with autoprefixer
npm run sass:watch
"scripts": {
"start": "concurrently -k -r \"npm:sass:watch\" \"npm:vite\"",
"start-open": "web-dev-server",
"format": "eslint --ext .js,.html . --fix --ignore-path .gitignore && prettier \"**/*.js\" --write --ignore-path .gitignore",
"lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.js\" --check --ignore-path .gitignore",
"sass:watch": "sass-style-template",
"test": "web-test-runner --coverage",
"test:watch": "web-test-runner --watch",
"vite": "vite",
"vite-build": "vite build",
"vite-preview": "vite preview"
},