GithubHelp home page GithubHelp logo

mikbry / rollupreactapp Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 798 KB

Boilerplate to create a React app using Rollup

License: MIT License

JavaScript 78.55% HTML 12.07% CSS 9.39%
react rollup babel esm es7

rollupreactapp's Introduction

rollup-react-app

Boilerplate to create a React app using Rollup.

Rollup is the right tool for bundling your javascript applications. But when you develop you still need Webpack ? You could rely on a well known article : Webpack and Rollup: the same but different But it is time to change our mind, and to remove Webpack. This template is a first step in this direction.

Another point rollup-create-app try to follow create-react-app, the source code, static assets, tests and structure are the same.

Why

  • Create a minimal from scratch React app using Rollup to bundle but also to develop instead of using Webpack.
  • Need for a complete boilerplate / example how to develop and bundle React app using Rollup
  • Stay compatible with create-react-app commands (start, build, test)
  • Develop using Nollup and Hot Module replacement (using experimental react-refresh)
  • Bundle 2 packages : an ESM one for (> 2018 browsers) and another one for olders, instead of create-react-app
  • Be compatible to good practices (Husky, Commitlint, ...)
  • Experiment new stuff (Nollup, Typescript)

WIP

  • Base code
  • Serve
  • Jsx support
  • Build for prod
  • Css / images
  • Hot reload
  • esm/iife scripts support
  • test
  • Typescript

Inspiration

https://create-react-app.dev/

https://stackoverflow.com/questions/51291553/how-to-bundle-react-app-with-rollup

https://github.com/DianaSuvorova/rollup-react-app

https://medium.com/@tomaszmularczyk89/guide-to-building-a-react-components-library-with-rollup-and-styled-jsx-694ec66bd2

Available Scripts

rollup-react-app tries to work as create-react-app, so commands are the same.

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:5000 to view it in the browser.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

Youc could test it using this command:

npx serve build -l 9000

yarn test

Run tests using jest. See src/App.test.jsx

yarn coverage

Does a code coverage report. A directory coverage is generated containing an html report.

rollupreactapp's People

Contributors

mikbry avatar dependabot[bot] avatar

Stargazers

Jay avatar  avatar

Watchers

 avatar  avatar

Forkers

d-e-f-e-a-t

rollupreactapp'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.