Vue.js

Vue.js

Vue.js is an open-source, progressive Javascript framework for building user interfaces that aim to be incrementally adoptable.
Paris  Kessler

Paris Kessler

1656892800

Vite React Express Docker Boilerplate

Vite React Express Docker Boilerplate

Quickly bootstrap a new project with Vite React Express Boilerplate.

This boilerplate is a fork of lmachens/vite-boilerplate, but replaces TypeScript with JavaScript, adds Docker, and removes Storybook.

This boilerplate contains all the tools you need to build a modern web app with Vite, Docker, React, and Express. You can use it to quickly bootstrap your project.

ESLint, stylelint, prettier, husky and lintstaged are configured to give you a solid development experience.

Installing / Developing

First, create a repository from this template.

Now you are ready to go:

docker-compose build

This will install the dependencies required to run the boilerplate.

docker-compose up

Boom! The Docker container will run your server and client in development mode.

The default PORTS are:

  • 3001 for the server
  • 3000 for the client

You can configure the server port by setting the PORT environment variable in .env.

KEYVALUE
PORT(Optional) Port for the server environment (defaults to 3001)

Building

To build the Docker image, run:

docker build -t vite-react-express .

To run the image locally:

docker run --rm  --name vite-react-express -p 3001:3001 vite-react-express:latest

and navigate to http://localhost:3001.

In production, you have a single server serving everything.

/api/* is the API endpoint.
/* is the client.

Tests

A test runner is not installed (right now). But ESLint and Prettier are checked on commit and pushed thanks to husky and lintstaged.


Author: joeynguyen
Source code: https://github.com/joeynguyen/vite-react-express-docker-boilerplate
License: MIT license

#vue #vite #docker #react 

Vite React Express Docker Boilerplate
Paris  Kessler

Paris Kessler

1656882000

Vite React Express Boilerplate: Full-Stack template with React

Vite React Express Boilerplate

Quickly bootstrap a new project with Vite React Express Boilerplate.

This boilerplate is a fork of lmachens/vite-boilerplate, but replaces TypeScript with JavaScript and removes Storybook.

This boilerplate contains all the tools you need to build a modern web app with JavaScript, React, Vite, and Express.
You can use it to quickly bootstrap your project.

ESLint, stylelint, prettier, husky and lintstaged are configured to give you a solid development experience.

Installing / Developing

First, create a repository from this template.

Now you are ready to go:

npm install

This will install the dependencies required to run the boilerplate.

npm run dev

Boom! These scripts run your server and client in development mode.

The default PORTS are:

  • 3001 for the server
  • 3000 for the client

If you don't like to call all scripts at once, you can also run:

npm run server:dev
npm run client:dev

You can configure the server port by setting the PORT environment variable. Creating a .env file is supported. You can copy .env.example to .env.

KEYVALUE
PORT(Optional) Port for the server environment (defaults to 3001)

Building

To build the project, run:

npm run build

This will build the client and server.

npm start

In production, you have a single server serving everything.

/api/* is the API endpoint.
/* is the client.

Tests

A test runner is not installed (right now). But ESLint and Prettier are checked on commit and pushed thanks to husky and lintstaged.


Author: joeynguyen
Source code: https://github.com/joeynguyen/vite-react-express-boilerplate
License: MIT license

#vue #vite #react 

Vite React Express Boilerplate: Full-Stack template with React
Meggie  Flatley

Meggie Flatley

1656871200

Vitawind Creator: Create TailwindCSS Project Rapidly.

 Vitawind πŸŒͺ⚑

The Lightning Wind , Stronger and Faster.

  • 🧰 Easy To Install
  • ⚑️ Automatically open Tailwind JIT Mode
  • βš™ One-Command Setting

Why Vitawind

Vitawind is a Vite helper that can help installing and setting up Tailwind CSS in few steps. Easy to use , just install Vitawind and add one line setting , you'll have the most fantastic developer experience !

Vite

Vite is the best frontend dev tool in my mind. Actually , Vite is really fast and convenient when your are devloping Vue or React project. Instead to Webpack is , Vite's Hot Module Replacement (HMR) resolve that devlopers always need to take a long long time for waiting dev server updated when modifying a very small thing.


Author: huibizhang
Source code: https://github.com/huibizhang/vitawind

Source code: https://vitawind.vercel.app/scaffolding/creator/
License:

#tailwindcss #vite #vue 

Vitawind Creator: Create TailwindCSS Project Rapidly.
Paris  Kessler

Paris Kessler

1656871200

Starter using Vite + React + TypeScript + Tailwind with Firebase

⚑ vite-react-ts-tailwind-starter

Starter using Vite + React + TypeScript + Tailwind with Firebase.

Motivation

Improve building your faster prototyping by using Vite, TypeScript, React, TailwindCSS, Firebase.

This starter uses following libraries:

  • Vite
  • React
    • React Router
  • TypeScript
  • Tailwind CSS
    • daisyUI
  • Firebase(v9, modular)
  • ESLint
  • Prettier

Set up

mv .env.local.example .env.local
yarn
yarn dev

Firebase

If you DO NOT use Firebase, you should do:

  • Delete the Firebase-related code: you check Main.tsx, SignInButton.tsx, SignOutButton.tsx.
  • And then delete src/lib/firebase.ts
  • Run yarn remove firebase
  • Remove VITE_FIREBASE_* env values from .env.local

If you want to use Firebase, you should do:

Vite

Vite is a fast frontend build tool. According to the README, it consists of two major parts:

  • A dev server that serves your source files over native ES modules, with rich built-in features and astonishingly fast Hot Module Replacement (HMR).
  • A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production.

React

React is a JavaScript library for building user interfaces.

Due to its awesome renderer system, there are many React Renderor. So React can be not used only Web, for example, used by React Native.

Let's dive into React and Vite can use with React.

TypeScript

TypeScript is a superset of JavaScript. It is just one of NPM library, but it provides an original compiler.

When you use TypeScript with React, you can write JSX with TypeScript, called TSX. Then you can develop views written by Type-Safe template.

Tailwind CSS

Tailwind CSS is modern utility-first CSS framework. It provides many CSS rules, but these are purged when production builds. So developers do not worry about CSS asset size for performance optimization.

In VSCode, I recommend to use intellisense extension.

Frequently, React developers are worried about how to write CSS in TSX(JSX) template. You must choose from CSS Modules, styled-components, linaria, and so on. Additionally, CSS architecture is difficult about scoping, e.g. BEM, FLOCSS.

When you decide to use Tailwind, you only write utility-first CSS classes, you don't have to worry about them!

daisyUI

daisyUI is Tailwind CSS Components library.

It prepares components CSS classes such as 'btn'. If you provide 'btn' class to <button> element, then there should be placed completely designed button.

If you don't want to use it, just remove the package and remove config in tailwind.config.js.

Firebase

Firebase is a PaaS that makes us create hi-quality apps so easy and so fast.

This library is not suitable for everyone, but I think it is one of the best libraries for prototyping. Therefore, I have added it to this repository.

The Firebase js SDK has become very useful in version 9, with optimizations that greatly reduce bundle size.

How to Use

Please look at firebase.ts.

There you will find a set of utility functions to manipulate Firebase for the environment in which the Emulator is used.

Formatter and Linter

Already set up ESLint and Prettier. You can customize the rules.

NOTICE: The template does not use eslint-plugin-prettier and prettier-eslint. So I recommend that running commands individually. e.g. prettier && eslint.

Please read: https://prettier.io/docs/en/integrating-with-linters.html.

ToDo


Author: TeXmeijin
Source code: https://github.com/TeXmeijin/vite-react-ts-tailwind-firebase-starter
License:

#vue #typescript #vite #firebase #tailwindcss #react-native 

Starter using Vite + React + TypeScript + Tailwind with Firebase
Fleta  Dickens

Fleta Dickens

1656867600

Rollup Plugin Yaml: Convert YAML Files to ES6 Modules

@rollup/plugin-yaml

🍣 A Rollup plugin which Converts YAML files to ES6 modules.

Requirements

This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.

Install

Using npm:

npm install @rollup/plugin-yaml --save-dev

Usage

Create a rollup.config.js configuration file and import the plugin:

import yaml from '@rollup/plugin-yaml';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [yaml()]
};

Then call rollup either via the CLI or the API.

With an accompanying file src/index.js, the local heroes.yaml file would now be importable as seen below:

// src/index.js
import { batman } from './heroes.yaml';

console.log(`na na na na ${batman}`);

Options

documentMode

Type: String
Default: single

If single, specifies that the target YAML documents contain only one document in the target file(s). If more than one document stream exists in the target YAML file(s), set documentMode: 'multi'.

exclude

Type: String | Array[...String]
Default: null

A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.

include

Type: String | Array[...String]
Default: null

A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

safe

Type: Boolean
Default: true

If true, specifies that the data in the target YAML file(s) contain trusted data and should be loaded normally. If false, data is assumed to be untrusted and will be loaded using safety methods.

transform

Type: Function
Default: undefined

A function which can optionally mutate parsed YAML. The function should return the mutated object, or undefined which will make no changes to the parsed YAML.

yaml({
  transform(data, filePath) {
    if (Array.isArray(data) && filePath === './my-file.yml') {
      return data.filter((character) => !character.batman);
    }
  }
});

Meta

CONTRIBUTING

LICENSE (MIT)


Author: rollup
Source Code: https://github.com/rollup/plugins/
License: 

#vue #vite #typescript #javascript #Rollup 

Rollup Plugin Yaml: Convert YAML Files to ES6 Modules
Meggie  Flatley

Meggie Flatley

1656860400

Vite Vue Tailwind V3: Starter Template for Vue3 + TailwindCSS

template-vite-vue-tailwind-v3

  • template of: vite + vue
  • tailwindcss: v3.x

Started

yarn
# or `npm install`

Develop

yarn dev
# or `npm run dev`

Build

yarn build
# or `npm run build`

Author: huibizhang
Source code: https://github.com/huibizhang/template-vite-vue-tailwind-v3
License:

#vue #vite #tailwindcss 

Vite Vue Tailwind V3: Starter Template for Vue3 + TailwindCSS
Paris  Kessler

Paris Kessler

1656853200

Vite Material Ui: A Vite Starter Template for React, TypeScript, MUI

React + TypeScript + MUI

A Vite template for React, TypeScript and the latest major version of MUI.

Highlights

  • React w/ TypeScript
  • Takes 8-10 seconds to build prod bundle at 198kb
  • v5 ( latest ) version of Material UI, @mui/material
  • Enables the @emotion/babel-plugin to work with MUI (see features)
  • Dark mode toggle
  • Aliased imports

Demo

Getting Started

  • Clone the repo, git clone https://github.com/christopher-caldwell/vite-material-ui.git, or use the "Use this template" button at the top of this page.
  • Install dependencies using yarn
  • Start the server with yarn dev

MUI

To learn more about the newest ways to use MUI, checkout the docs.

What's Included

  • Custom theming
  • Using that theme from within a styled component
  • Dark mode toggle with React Context
  • Aliased imports with @/ mapping to the src/
  • Rollup bundle analyzer
    • To use, run yarn analyze

Author: christopher-caldwell
Source code: https://github.com/christopher-caldwell/vite-material-ui
License:

#vue #vite #typescript #react-native 

Vite Material Ui: A Vite Starter Template for React, TypeScript, MUI
Meggie  Flatley

Meggie Flatley

1656849600

Template Project: Vite, Vue 3, VueI18n, Storybook, TS, ESLint, Prettie

Vue 3 + i18n + Typescript + Vite + Storybook + ESLint + Prettier

This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Create stories with Typescript

You can write stories with JavaScript or Typescript alike as both your dev server and storybook server allow it. Start writing stories with this introduction

Add translations to locales files

Translations are ready to go with vue-i18 Add your files to /locales and are you are set.

ESLint

Change your config at .eslintrc.js

Prettier

Change config at .prettierrc

Scripts

yarn // installs packages
yarn vite // starts the dev server
yarn build // run build
yarn serve // preview build
yarn storybook // starts storybook
yarn lint // lint and fix all files
yarn format // run prettier on all files

Recommended IDE Setup

Type Support For .vue Imports in TS

Since TypeScript cannot handle type information for .vue imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue imports (for example to get props validation when using manual h(...) calls), you can enable Volar's .vue type support plugin by running Volar: Switch TS Plugin on/off from VSCode command palette.

Folder structure

.
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ robots.txt
β”‚   └── svg
β”‚       β”œβ”€β”€ eslint.svg
β”‚       β”œβ”€β”€ prettier.svg
β”‚       β”œβ”€β”€ storybook.svg
β”‚       β”œβ”€β”€ ts.svg
β”‚       β”œβ”€β”€ vite.svg
β”‚       └── vue.svg
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ App.vue
β”‚   β”œβ”€β”€ assets
β”‚   β”‚   └── fonts
β”‚   β”‚       └── overpass-regular.otf
β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ HelloWorld.vue
β”‚   β”‚   └── LocaleSelect.vue
β”‚   β”œβ”€β”€ data
β”‚   β”‚   └── links.json
β”‚   β”œβ”€β”€ locales
β”‚   β”‚   β”œβ”€β”€ en.json
β”‚   β”‚   β”œβ”€β”€ pt.json
β”‚   β”‚   └── zh.json
β”‚   β”œβ”€β”€ main.ts
β”‚   β”œβ”€β”€ shims-vue.d.ts
β”‚   β”œβ”€β”€ stories
β”‚   β”‚   β”œβ”€β”€ BasicButton.stories.ts
β”‚   β”‚   β”œβ”€β”€ BasicButton.vue
β”‚   β”‚   β”œβ”€β”€ Header.stories.js
β”‚   β”‚   β”œβ”€β”€ Header.vue
β”‚   β”‚   β”œβ”€β”€ Introduction.stories.mdx
β”‚   β”‚   β”œβ”€β”€ Page.stories.js
β”‚   β”‚   β”œβ”€β”€ Page.vue
β”‚   β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”‚   β”œβ”€β”€ code-brackets.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ colors.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ comments.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ direction.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ flow.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ plugin.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ repo.svg
β”‚   β”‚   β”‚   └── stackalt.svg
β”‚   β”‚   β”œβ”€β”€ header.css
β”‚   β”‚   └── page.css
β”‚   β”œβ”€β”€ styles
β”‚   β”‚   β”œβ”€β”€ _colors.scss
β”‚   β”‚   β”œβ”€β”€ _font.scss
β”‚   β”‚   β”œβ”€β”€ _reset.scss
β”‚   β”‚   β”œβ”€β”€ boot.scss
β”‚   β”‚   └── functions
β”‚   β”‚       └── _color.scss
β”‚   └── types
β”‚       └── Size.ts
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ vite.config.ts
└── yarn.lock

Author: Miguel-Bento-Github
Source code: https://github.com/Miguel-Bento-Github/vite-vue-ts-storybook
License: MIT license

#vite #vue 

Template Project: Vite, Vue 3, VueI18n, Storybook, TS, ESLint, Prettie
Michele  Herman

Michele Herman

1656846000

Vite Plugin Simple Vconsole: VConsole Plugin for Vite, Easy to Use

vite-plugin-simple-vconsole

vConsole plugin for vite, support both MPA and SPA.

Install

yarn add vite-plugin-simple-vconsole -D
# or
npm i vite-plugin-simple-vconsole -D

Example

See example

cd example

# yarn
yarn
yarn dev

# pnpm
pnpm i
pnpm dev

Usage

// vite.config.js
import vConsolePlugin from 'vite-plugin-simple-vconsole'

export default {
  plugins: [
    vConsolePlugin({
      enable: true,
    }),
  ]
}
interface VConsolePluginOptions {
    enable?: boolean;
    src?: string; // cdn url, default is https://unpkg.com/vconsole@latest/dist/vconsole.min.js
    theme?: 'light' | 'dark';
}

Options

enable

  • Type: boolean
  • Default: false

src

  • Type: string
  • Default: 'https://unpkg.com/vconsole@latest/dist/vconsole.min.js'

this script will be injected to body of the entry html

theme

  • Type: 'light' | 'dark'
  • Default: 'light'

vConosle theme


Author: venojs
Source code: https://github.com/venojs/vite-plugin-simple-vconsole
License: MIT license

#vite #vue 

Vite Plugin Simple Vconsole: VConsole Plugin for Vite, Easy to Use
Fleta  Dickens

Fleta Dickens

1656846000

A Rollup Plugin Which Loads Virtual Modules From Memory

@rollup/plugin-virtual

🍣 A Rollup plugin which loads virtual modules from memory.

Requirements

This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.

Install

Using npm:

npm install @rollup/plugin-virtual --save-dev

Usage

Note. Use this plugin before any others such as node-resolve or commonjs, so they do not alter the output.

Suppose an entry file containing the snippet below exists at src/entry.js, and attempts to load batman and src/robin.js from memory:

// src/entry.js
import batman from 'batman';
import robin from './robin.js';

console.log(batman, robin);

Create a rollup.config.js configuration file and import the plugin:

import virtual from '@rollup/plugin-virtual';

export default {
  input: 'src/entry.js',
  // ...
  plugins: [
    virtual({
      batman: `export default 'na na na na na'`,
      'src/robin.js': `export default 'batmannnnn'`
    })
  ]
};

Then call rollup either via the CLI or the API.

Options

This plugin has no formal options. The lone parameter for this plugin is an Object containing properties that correspond to a String containing the virtual module's code.

Using the Plugin for Bundle Input

It's possible to use the plugin to specify an entry point for a bundle. To do so, implement a pattern simple to what is shown below:

import virtual from '@rollup/plugin-virtual';

export default {
  input: 'entry',
  // ...
  plugins: [
    virtual({
      entry: `
import batman from 'batcave';
console.log(batman);
`
    })
  ]
};

License

MIT


Author: rollup
Source Code: https://github.com/rollup/plugins/
License: 

#vue #vite #typescript #javascript #Rollup 

A Rollup Plugin Which Loads Virtual Modules From Memory
Paris  Kessler

Paris Kessler

1656842400

Server Side Rendering Project Template Base on Vite + React

Vite React SSR

Server Side Rendering project template base on Vite + React.

Fully type declaration with TypeScript.

Support:

  • fetch InitialData in client-server.ts
  • client-only component support with @loadable/component
  • SEO, react-helmet

fetch InitialData

// client-server.ts
async loadData() {
  // ...

  // fetch initial data thisway.
  const apiUrl = env.APIURL
  const $http = axios.create({ baseURL: apiUrl })
  const { data } = await $http.get('aggregate')
  // dict is page's fetched data
  return { ...dict, ...{ initialData: data } }
}

And, you can add other hook to use Initial data.

// use-initial-data.ts

export const useInitialData = () => {
  return useContext(SSRContext).initialData as YourResponseType
}

Client only component

load component with @loadable/component, and you can do this with dynamic import, vite will split page view into chunk.

import loadable from '@loadable/component'
const OnlyClient: FC = () => {
  return <span>{location.href}</span>
}

const OT = loadable(() => Promise.resolve(OnlyClient), { ssr: false })

const Test: SSRPage = (props) => {
  return (
    <>
      <h1>Test</h1>
      <OT />
    </>
  )
}

loadData

Define component loadData function:

// pages/demo.tsx
function Demo(props) {
  // must type guard first
  if (!props.loaded) {
    return <span>Loading..</span>
  }
  // if loaded, then can access `data`, either you will get `undefined`
  return <>{JSON.stringify(props.data.list)}</>
}

// ssr data load
Demo.loadData = async (ctx) => {
  const [list, count] = await doRequest()
  return {
    // redirect: '/user/1234', // Switch to route
    // redirect: 'https://other.com?w=123', // Redirect to site

    // props.list
    list: [],
    // props.count
    count: 10,
  }
}

export default Demo

ctx:

  • ctx.isSSR boolean whether is SSR.
  • ctx.url string Url for request.
  • ctx.query object Query params for request.
  • ctx.params object route params for request.
  • ctx.req When server rendering.

Router

// src/router.jsx
import Router from './components/router'
import Home from './pages/Home'
import User from './pages/User'
import About from './pages/About'
import NotFound from './pages/NotFound'
import Layout from './pages/Layout'
import Page1 from './pages/Layout/Page-1'
import Page2 from './pages/Layout/Page-2'

export default new Router({
  routes: [
    { path: '/', component: Home },
    { path: '/user/:userId', component: User },
    {
      path: '/layout',
      component: Layout,
      routes: [
        { path: '/layout/page-1', component: Page1 },
        { path: '/layout/page-2', component: Page2 },
      ],
    },
    { path: '/about', component: About },
    { label: '404', component: NotFound },
  ],
})

Start

dev

npm run dev

build

npm run build

serve

npm run serve

Deploy

1、build

npm run build

2、serve

cross-env NODE_ENV=production node server

Shot

Z9fSfV4


Author: Innei
Source code: https://github.com/Innei/vite-react-ssr
License:

#vite #react #vue 

Server Side Rendering Project Template Base on Vite + React
Meggie  Flatley

Meggie Flatley

1656838800

Vite Pinia TypeScript Windi Starter

Vite - Pinia - TypeScript - Windi Starter

Vite - Vue 3 - Pinia - Vue Router 4 - TypeScript - Windi CSS - ESLint - Prettier

This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

⚑️ Vue 3,

⚑️ Vite 2, ESBuild

🍍 State Management via Pinia

🎨 Windi CSS

🎨 ESLint, Prettier

🦾 Vue Router 4

🦾 TypeScript

Installation

# clone the project
git clone https://github.com/yoruk-alper/vite-pinia-ts-windi-starter.git

# open the project directory
cd vite-pinia-ts-windi-starter

# install dependencies
npm install

# start the application
npm run dev

# make a production build
npm run build

screenshot

Type Support For .vue Imports in TS

Since TypeScript cannot handle type information for .vue imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue imports (for example to get props validation when using manual h(...) calls), you can enable Volar's .vue type support plugin by running Volar: Switch TS Plugin on/off from VSCode command palette.


Author: yoruk-alper
Source code: https://github.com/yoruk-alper/vue-pinia-ts-windi-starter
License:
#vue #vite #typescript 

Vite Pinia TypeScript Windi Starter
Fleta  Dickens

Fleta Dickens

1656835200

Rollup Plugin Strip: Remove Debugger Statements and Functions

@rollup/plugin-strip

🍣 A Rollup plugin to remove debugger statements and functions like assert.equal and console.log from your code.

Requirements

This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.

Install

Using npm:

npm install @rollup/plugin-strip --save-dev

Usage

Create a rollup.config.js configuration file and import the plugin:

import strip from '@rollup/plugin-strip';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [
    strip({
      labels: ['unittest']
    })
  ]
};

Then call rollup either via the CLI or the API.

Options

include

Type: String | RegExp | Array[...String|RegExp]
Default: ['**/*.js']
Example: include: '**/*.(mjs|js)',
 

A pattern, or array of patterns, which specify the files in the build the plugin should operate on.

exclude

Type: String | RegExp | Array[...String|RegExp]
Default: []
Example: exlude: 'tests/**/*',
 

A pattern, or array of patterns, which specify the files in the build the plugin should ignore.

debugger

Type: Boolean
Default: true
Example: debugger: false,
 

If true instructs the plugin to remove debugger statements.

functions

Type: Array[...String]
Default: [ 'console.*', 'assert.*' ]
Example: functions: [ 'console.log', 'MyClass.Test' ],
 

Specifies the functions that the plugin will target and remove.

Note: specifying functions that are used at the begining of a chain, such as 'a().b().c()', will result in '(void 0).b().c()' which will generate an error at runtime.

labels

Type: Array[...String]
Default: []
Example: labels: ['unittest'],
 

Specifies the labeled blocks or statements that the plugin will target and remove.

Note: the ':' is implied and should not be specified in the config.

sourceMap

Type: Boolean
Default: true
Example: sourceMap: false,
 

If true, instructs the plugin to update source maps accordingly after removing configured targets from the bundle.

Meta

CONTRIBUTING

LICENSE (MIT)


Author: rollup
Source Code: https://github.com/rollup/plugins/
License: 

#vue #vite #typescript #javascript #Rollup 

Rollup Plugin Strip: Remove Debugger Statements and Functions
Paris  Kessler

Paris Kessler

1656831600

Vite React Tailwind Template

Vite React Tailwind Template

This template provide toolchain below:

  • Vite
  • React, ReactDOM
  • ESLint
  • Prettier
  • Git Hook (Husky, Lint Staged)
  • TailwindCSS 2 (JIT)

Usage

pnpm i
pnpm dev

Screenshot


Author: Innei
Source code: https://github.com/Innei/vite-react-tailwind-template
License:

#vue #vite #tailwindcss #react 

Vite React Tailwind Template
Meggie  Flatley

Meggie Flatley

1656828000

To Develop Web Component By using Vite + Vue 3 + Typescript

⚑Vite + Vue 3 + Typescript + Web Component

This is a boiler plate to show how to develop Web Component by using Vite + Vue 3 + typescript.

Especially, it might be helpful to implement small part UI by using vue3 + typescript, while you work on big legacy web project.

How to run

Please run steps below to run it as development mode.

git clone https://github.com/skysign/vite-vue3-typescript-webcomponent.git
cd vite-vue3-typescript-webcomponent
npm install
npm run dev

Now you can see two buttons, and numbers are increasing by clicking. One web component have two buttons and

How to release

Please run 'build' not 'dev'.

npm run build

You can see that html, js files are generated in './dist' folder.

Please run simple web server to see how web component works in browser.

npx http-server ./dist

Author: skysign
Source code: https://github.com/skysign/vite-vue3-typescript-webcomponent
License: Apache-2.0 license

#vue #vite #typescript 

To Develop Web Component By using Vite + Vue 3 + Typescript