Coder Social home page Coder Social logo

shiftregister-vg / buble-react-rollup-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yamafaktory/buble-react-rollup-starter

0.0 2.0 0.0 13 KB

A simple starter project to build cool React applications with Bublé and Rollup.

License: MIT License

JavaScript 72.43% HTML 27.57%

buble-react-rollup-starter's Introduction

buble-react-rollup-starter Build Status npm version js-standard-style

A simple starter project to build cool React applications with Bublé and Rollup.

The aim of this project is to provide a simple boilerplate to get started with React bundled as an ES2015 module via Rollup, compiled by Bublé.

To sum up and give an overview of what can be achieved like a breath of fresh air:

// Import React, ReactDOM and the DummyComponent.
import React from 'react'
import ReactDOM from 'react-dom'
import { DummyComponent } from './components/dummy-component.jsx'

// Define the root element and instantiate the DummyComponent.
const root = document.querySelector('main')
const dummyComponent = React.createElement(DummyComponent)

// Append the DummyComponent instance to the root element.
ReactDOM.render(dummyComponent, root)

Rollup will magically includes only what you need in your bundle depending on the imports!

Prerequisite

NodeJS

The easiest way to go is to use nvm and to install one of the recent NodeJS versions bundled with npm 3 by default (i.e. NodeJS >= 5.0.0).

Installation

Clone this repository.

git clone https://github.com/yamafaktory/buble-react-rollup-starter
cd buble-react-rollup-starter
npm i

Or even better, use npm!

npm i buble-react-rollup-starter

Usage

Development

A basic workflow involving Browsersync is already implemented. Running the following command will open your default browser pointing to the html/index-dev.html file. Any modification of one of the files included in the src directory will trigger a new development build and refresh your browser:

npm start

You can also generate a development build by running the following command:

npm run build:dev

Production

First run the following command:

npm run build

Then open the html/index.html file in your browser.

The Rollup production configuration file switch the NodeJS environment to production and minify the code with UglifyJS.

Linting

The code quality is checked by the JavaScript Standard Style.

License

Released under the MIT license by Davy Duperron.

buble-react-rollup-starter's People

Contributors

konsumer avatar yamafaktory avatar

Watchers

 avatar  avatar

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.