Coder Social home page Coder Social logo

eunchurnpark / webpack-react-es6-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eunchurn/webpack-react-es6-boilerplate

0.0 1.0 0.0 507 KB

A basic boilerplate for a ReactJS project compiled with Webpack and transpiled via Babel to enable using ES6 syntax.

JavaScript 94.63% CSS 1.38% HTML 4.00%

webpack-react-es6-boilerplate's Introduction

React Webpack ES6 Boilerplate

Esau Silva 튜토리얼 (번역) 기반 Features

  • Hot Module Replacement (HMR)
  • Code Split (by Chunk)
  • Code Split (by Vendor)
  • Production build (Webpack config files)
  • Webpack Composition

Additional features

  • core-js@2 Polyfill Applied

index.js

import 'react-app-polyfill/ie9'; // For IE 9-11 support
import 'react-app-polyfill/ie11'; // For IE 11 support
import './polyfill'

polyfill.js

IE9, IE10 and IE11 requires all of the following polyfills.

import 'core-js/es6/symbol'
import 'core-js/es6/object'
import 'core-js/es6/function'
import 'core-js/es6/parse-int'
import 'core-js/es6/parse-float'
import 'core-js/es6/number'
import 'core-js/es6/math'
import 'core-js/es6/string'
import 'core-js/es6/date'
import 'core-js-pure/es/array'
import 'core-js/es6/regexp'
import 'core-js-pure/es/map'
import 'core-js/es6/weak-map'
import 'core-js-pure/es/set'
import 'core-js-pure/es/object'

IE10 and IE11 requires the following for the Reflect API.

import 'core-js/es6/reflect'

Evergreen browsers require these. Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.

import 'core-js/es7/reflect'
  • Manifesto generation and Assets (public/assets copy to dist for production build)
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
...
  plugins: [
...
    new CopyWebpackPlugin([
      { from : 'public/assets', to : 'assets'}
    ]),
    new ManifestPlugin()
  ],

Getting started

Install dependencies

npm i

Then run dev script

npm run dev

Open localhost:3000

Build

npm run build

Cleans existing dist folder while linting src folder. Then sets environment to production and compiles into dist.

webpack-react-es6-boilerplate's People

Contributors

eunchurn avatar

Watchers

James Cloos 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.