Giter VIP home page Giter VIP logo

react-redux-todolist's Introduction

React*Redux TodoList App

開発環境構築

初期設定

package.jsonを生成。初期設定をスキップするため���-yオプションを付けている。

$ npm init -y 

babelと���webpackをインストール

-D--save-dev と同義でpackage.json の devDependencies に自動的に記録するためのオプション。

$ npm i -D babel-core babel-loader babel-preset-es2015 babel-preset-react

babelの設定ファイル�を作成。 �

$ touch .babelrc

.babelrc��には�ES6を利用するために以下のように記述する。

{
  "presets": [
    "es2015", "react"
  ]
}

次にwebpackをインストール。

$ npm i -D webpack

�webpackのコンフィグファイルを作成。

$ touch webpack.config.js
module.exports = {
    entry: {
        index: 'src/js/index.js'
    },
    output: {
        path: __dirname,
        filename: '[name].min.js'
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel-loader',
                query: {
                    presets: ['es2015', 'react']
                }
            }
        ]
    },
    resolve: {
        extensions: ['', '.js', '.jsx']
    }
}

React*Reduxパッケージのインストール

Reactのパッケージをインストール。 -S を付けておくと�package.jsonのでdependenciesに反映する。 �

$ npm i -S react react-dom redux react-redux

webpack-dev-serverのインストール

�webpackには�webpack-dev-serverというモジュールが用意されていて、これを使うと�webサーバーを通して動作確認しながら開発することができる。 また、ソースコードの変更を検知して自動ビルドしてくれる。 �html-webpack-plugin はビルドしたJSファイルを読み込むようになっている�index.htmlを生成してくれるプラグイン。

$ npm i -D webpack-dev-server

react-redux-todolist's People

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.