Gioni06 / open-wc-vitejs-sass

OPEN-WC & VITEJS & SCSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OPEN-WC & VITEJS & SCSS

    • scaffold
    • lint
    • format
    • test
    • dev server
    • build command
    • SCSS watcher with autoprefixer

Installation

npm i

Usage

<script type="module">
  import 'my-element-openwc-vitejs/my-element-openwc-vitejs.js';
</script>

<my-element-openwc-vitejs></my-element-openwc-vitejs>

open-wc

Linting and formatting

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

Testing with Web Test Runner

To execute a single test run:

npm run test

To run the tests in interactive watch mode run:

npm run test:watch

Tooling configs

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.


vitejs

dev server

npm run vite

build command

npm run vite-build

sass

SCSS watcher with autoprefixer

npm run sass:watch

scripts - package.json

"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"
  },

About

OPEN-WC & VITEJS & SCSS

License:MIT License


Languages

Language:JavaScript 89.7%Language:HTML 6.4%Language:SCSS 3.9%