From d4215256bfe8d59574c9bfcc3017dcf9b728cf01 Mon Sep 17 00:00:00 2001 From: Caroline Shaw Date: Wed, 19 Apr 2017 10:35:47 -0400 Subject: [PATCH 1/3] Updated refs to loaders in webpack config & component for webpack 2.0 --- src/component/growler.jsx | 2 +- webpack.config.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/component/growler.jsx b/src/component/growler.jsx index 7b7598a..9098c95 100644 --- a/src/component/growler.jsx +++ b/src/component/growler.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import 'style!./growler.scss'; +import 'style-loader!./growler.scss'; import classNames from 'classnames/bind'; import errors from 'classnames/bind'; diff --git a/webpack.config.js b/webpack.config.js index ee14dd9..35d5dea 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,9 +6,9 @@ module.exports = { }, module: { loaders: [ - { test: /\.css$/, loader: "style!css" }, - { test: /\.js$/, loaders: ['react-hot', 'babel?stage=0&loose[]=es6.modules'] }, - { test: /\.jsx$/, loaders:['react-hot', 'babel?stage=0&loose[]=es6.modules'] } + { test: /\.css$/, loader: "style-loader!css" }, + { test: /\.js$/, loaders: ['react-hot-loader', 'babel-loader?stage=0&loose[]=es6.modules'] }, + { test: /\.jsx$/, loaders:['react-hot-loader', 'babel-loader?stage=0&loose[]=es6.modules'] } ] } }; \ No newline at end of file From faac99835ed525b2f07508a2593c4c4319171caa Mon Sep 17 00:00:00 2001 From: Caroline Shaw Date: Thu, 20 Apr 2017 15:51:47 -0400 Subject: [PATCH 2/3] Fix to wording --- src/actions/growler.action.js | 10 +++++----- src/actions/types/growler.types.js | 2 +- src/reducer/growler.reducer.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/actions/growler.action.js b/src/actions/growler.action.js index a03731c..6dadc8d 100644 --- a/src/actions/growler.action.js +++ b/src/actions/growler.action.js @@ -1,4 +1,4 @@ -import {GROWLER__HIDE, GROWLER__HIDED, GROWLER__SHOW} from './types/growler.types'; +import {GROWLER__HIDE, GROWLER__HIDDEN, GROWLER__SHOW} from './types/growler.types'; let hideTimeOut; let hiddenTimeOut; /* @@ -11,7 +11,7 @@ export function hideGrowler() { clearTimeout(hideTimeOut); hiddenTimeOut = window.setTimeout(() =>{ dispatch({ - type: GROWLER__HIDED, + type: GROWLER__HIDDEN, }); }, 500); }; @@ -32,7 +32,7 @@ export function hideTimeOutGrowler(growler, time) { } export function showGrowler(text, type) { - return { + return { type: GROWLER__SHOW, growler:{ text, @@ -43,7 +43,7 @@ export function showGrowler(text, type) { export function showGrowlerSuccess(text) { - return { + return { type: GROWLER__SHOW, growler:{ text, @@ -53,7 +53,7 @@ export function showGrowlerSuccess(text) { } export function showGrowlerError(text) { - return { + return { type: GROWLER__SHOW, growler:{ text, diff --git a/src/actions/types/growler.types.js b/src/actions/types/growler.types.js index 6336965..dd4921d 100644 --- a/src/actions/types/growler.types.js +++ b/src/actions/types/growler.types.js @@ -4,4 +4,4 @@ export const GROWLER__SHOW = 'GROWLER__SHOW'; export const GROWLER__HIDE = 'GROWLER__HIDE'; -export const GROWLER__HIDED = 'GROWLER__HIDED'; +export const GROWLER__HIDDEN = 'GROWLER__HIDDEN'; diff --git a/src/reducer/growler.reducer.js b/src/reducer/growler.reducer.js index 640842c..766ef3f 100644 --- a/src/reducer/growler.reducer.js +++ b/src/reducer/growler.reducer.js @@ -1,4 +1,4 @@ -import {GROWLER__HIDE, GROWLER__HIDED, GROWLER__SHOW} from '../actions/types/growler.types'; +import {GROWLER__HIDE, GROWLER__HIDDEN, GROWLER__SHOW} from '../actions/types/growler.types'; const initialState = { text: '', @@ -23,7 +23,7 @@ export default function growlerReducer(state = initialState, action) { status: 'hide', }; - case GROWLER__HIDED: + case GROWLER__HIDDEN: return { ...state, ...action.growler, From 76f8b19161d3647f6e01294c02a21e2c977fae51 Mon Sep 17 00:00:00 2001 From: Caroline Shaw Date: Tue, 9 May 2017 09:43:44 -0400 Subject: [PATCH 3/3] Webpack 2 migration --- webpack.config.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 35d5dea..b7ace82 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,10 +5,15 @@ module.exports = { filename: "es5/index.js" }, module: { - loaders: [ - { test: /\.css$/, loader: "style-loader!css" }, - { test: /\.js$/, loaders: ['react-hot-loader', 'babel-loader?stage=0&loose[]=es6.modules'] }, - { test: /\.jsx$/, loaders:['react-hot-loader', 'babel-loader?stage=0&loose[]=es6.modules'] } + rules: [{ + test: /\.css$/, + use: [{ + 'loader': 'style-loader' + }, { + 'loader': 'css' + }] }, + { test: /\.js$/, use: ['react-hot-loader', 'babel-loader?stage=0&loose[]=es6.modules'] }, + { test: /\.jsx$/, use:['react-hot-loader', 'babel-loader?stage=0&loose[]=es6.modules'] } ] } }; \ No newline at end of file