GithubHelp home page GithubHelp logo

wp-blocks / vite-block Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 117 KB

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.

TypeScript 75.01% SCSS 13.55% PHP 11.44%
gutenberg gutenberg-blocks vitejs wordpress

vite-block's Introduction

image

Vite 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/react and @types/react-dom: TypeScript definitions for React.
  • @types/wordpress__block-editor and @types/wordpress__blocks: TypeScript definitions for WordPress block editor and blocks.
  • @typescript-eslint/eslint-plugin and @typescript-eslint/parser: ESLint plugin and parser for TypeScript.
  • @vitejs/plugin-react: Vite plugin for React.
  • @wordpress/block-editor and @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

  1. Run npm start to start the development server.
  2. Develop your WordPress blocks using Vite's fast development environment.
  3. Test and lint your code using npm run dev and npm run lint.
  4. 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!

<script type="module" src="http://localhost:5173/@vite/client"></script> <script type="module" src="http://localhost:5173/main.js"></script>`

and this has to be appended before the above scripts <script type="module"> import RefreshRuntime from 'http://localhost:5173/@react-refresh' RefreshRuntime.injectIntoGlobalHook(window) window.$RefreshReg$ = () => {} window.$RefreshSig$ = () => (type) => type window.__vite_plugin_react_preamble_installed__ = true </script> -->

vite-block's People

Contributors

erikyo avatar

Watchers

 avatar

vite-block's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.