Coder Social home page Coder Social logo

react-handson_vol02's Introduction

第2回 Reactハンズオン 初等部編

導入

npm install

mkdir react-handson_vol02
cd react-handson_vol02
npm init
npm install --save-dev webpack webpack-dev-server
npm install --save material-ui react react-dom react-tap-event-plugin
npm install --save-dev babel-loader babel-core babel-preset-es2015 babel-preset-react css-loader file-loader style-loader

package.json

scriptを追記  

"scripts": {
  "build": "webpack",
  "watch": "webpack --watch",
  "start": "webpack-dev-server --inline"
},

webpack.config.js

module.exports = {
  context: __dirname + "/src",
  entry: {
    js: "./App.js",
    css: "./App.css",
    html: "./index.html",
  },
  output: {
    path: __dirname + "/dist",
    filename: 'bundle.js',
  },
  devServer: {
    contentBase: 'dist',
    port: 3000
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: /node_modules/,
        query: {
          presets: ['es2015', 'react']
        }
      },
      {
        test: /\.css/,
        loader: 'style!css'
      },
      {
        test: /\.html$/,
        loader: 'file?name=[path][name].[ext]'
      }
    ]
  }
};

実行

npm start

http://localhost:3000を開く

Material UI

http://www.material-ui.com/#/

react-handson_vol02's People

Contributors

takanorip avatar

Watchers

 avatar  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.