3

Github GitHub - preactjs/wmr: 👩‍🚀 The tiny all-in-one development tool for moder...

 3 years ago
source link: https://github.com/preactjs/wmr
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

The tiny all-in-one development tool for modern web apps, in a single 2mb file with no dependencies.

All the features you'd expect and more, from development to production:

hammer   No entry points or pages to configure - just HTML files with <script type=module>
otter   Safely import "packages" from npm without installation
package   Smart bundling and caching for npm dependencies
↻   Hot reloading for modules, Preact components and CSS
zap   Lightning-fast JSX support that you can debug in the browser
lipstick   Import CSS files and CSS Modules (*.module.css)
nut_and_bolt   Out-of-the-box support for TypeScript
open_file_folder   Static file serving with hot reloading of CSS and images
clamp   Highly optimized Rollup-based production output (wmr build)
bookmark_tabs   Crawls and pre-renders your app's pages to static HTML at build time
racing_car   Built-in HTTP2 in dev and prod (wmr serve --http2)
wrench   Supports Rollup plugins, even in development where Rollup isn't used

Quickstart (recommended)

Create a new project in seconds using create-wmr:

npm init wmr your-project-name

yarn create wmr your-project-name

tipping_hand_person If you'd like ESLint to be set up for you, add --eslint to the command. Note: this will use 150mb of disk space.

Check out the docs to learn more

Packages

Package Description Version wmr Tiny all-in-one development tool for modern web apps

create-wmr Create a new WMR project in seconds

@wmr-plugins/directory-import Import a directory's files as an Array

@wmr-plugins/nomodule Generate legacy fallback bundles for older browsers

@wmr-plugins/service-worker Bundle service workers

preact-iso Optimal code-splitting, hydration and routing for Preact

Contributing

git clone [email protected]:preactjs/wmr.git
cd wmr
yarn

# run the demo (no compile)
yarn demo serve

# build and serve the demo for prod
yarn demo build:prod && yarn demo serve:prod

# build the single-file CLI:
yarn workspace wmr build

Adding a changeset

Don't forget to also include a changeset, by runing this command at the root of the project:

yarn changeset

This will take you through a process of selecting the changed packages, the version updates and a description of the change. Aferwards, changesets, will generate a .md file inside a .changeset directory. Please commit that file as well.

After all that, you are good to go. :+1


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK