Vite Block
Vite Block is an experimental WordPress block development repository that explores the usage of Vite as a replacement for webpack, leveraging its advantages in ES module (ESM) support, faster build times, and efficient development workflows.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/wp-blocks/vite-block/archive/refs/heads/master.zipVite Block for Wordpress
Vite Block is an experimental WordPress block development repository that explores the usage of Vite as a replacement for webpack, leveraging its advantages in ES module (ESM) support, faster build times, and efficient development workflows.
Installation
To get started, clone this repository and navigate to the project directory.
git clone https://github.com/your-username/vite-block.git
cd vite-block
Install the dependencies using npm:
npm install
Scripts
npm run packages-update: Update WordPress packages using wp-scripts.npm start: Build the project with TypeScript and Vite, watching for changes.npm run build: Build the project with TypeScript and Vite.npm run dev: Run the development server with Vite.npm run lint: Lint the project using ESLint.npm run wp-env:start: Start the WordPress development environment.npm run wp-env:stop: Stop the WordPress development environment.npm run wp-env:destroy: Destroy the WordPress development environment.npm run plugin-zip: Package the plugin for distribution.
DevDependencies
@types/node: TypeScript definitions for Node.js.@types/reactand@types/react-dom: TypeScript definitions for React.@types/wordpress__block-editorand@types/wordpress__blocks: TypeScript definitions for WordPress block editor and blocks.@typescript-eslint/eslint-pluginand@typescript-eslint/parser: ESLint plugin and parser for TypeScript.@vitejs/plugin-react: Vite plugin for React.@wordpress/block-editorand@wordpress/blocks: WordPress block editor and blocks packages.eslint,eslint-plugin-react-hooks,eslint-plugin-react-refresh: ESLint and plugins for React linting.sass: Sass compiler.terser: JavaScript minifier.typescript: TypeScript compiler.vite: Vite bundler for faster development.vitest: Test runner for Vite.
Development Workflow
- Run
npm startto start the development server. - Develop your WordPress blocks using Vite's fast development environment.
- Test and lint your code using
npm run devandnpm run lint. - Package your plugin for distribution using
npm run plugin-zip.
Contributing
Feel free to contribute to this experimental project by opening issues, suggesting enhancements, or submitting pull requests. Your feedback and contributions are highly appreciated.
License
This project is licensed under the GPL-2.0-or-later license. See the LICENSE.md file for details.
Thank you for checking out Vite Block! Happy coding!
`
and this has to be appended before the above scripts `` -->