Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade npm modules, add superagent sample and enable postcss #5

Merged
merged 2 commits into from
May 5, 2018

Conversation

shimomuh
Copy link
Owner

@shimomuh shimomuh commented May 5, 2018

内容

掲題の通り
ダイジェストは以下。

  • webpack3 to 4
  • postcss を有効化
  • superagent で XHR のリクエスト関数を生やしておくことでサーバ連携があったときにも容易に対応できるように

"postcss-loader": "2.1.5",
"sass-loader": "7.0.1",
"style-loader": "0.21.0",
"webpack": "4.7.0",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主な変更点。
webpack 3 -> 4

"extract-text-webpack-plugin": "3.0.2",
"flow-bin": "0.66.0",
"css-loader": "0.28.11",
"extract-text-webpack-plugin": "4.0.0-beta.0",
Copy link
Owner Author

@shimomuh shimomuh May 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpack 4 に伴い extract-text-webpack-plugin もアップデート。
ただし、通常の最新版は webpack 4 に対応していない。

そこで、 extract-text-webpack-plugin@next を利用することで対応した。

}
)

module.exports = { plugins: [autoprefixer] }
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loader はいたが、設定ファイルがなかったので、配置して有効化

return resolve({ data: res.body, status: res.status })
})
})
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XHR 関連メソッド。
adapter として定義しているが、サンプルでは利用していない

// const { data } = yield call(XHRpost, '/test', payload)
// yield put(CounterRedux.creators.reset(data))
// }
//}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

サンプル。
利用シーンがなかったので、コメントアウト。

@@ -32,9 +32,6 @@ const javascript = {
plugins: [
new webpack.ProvidePlugin({
'React': 'react'
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'javascripts/commons/chunk'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpack4 で違う記述になったが、小さなコンポーネントなので、 optimization のオプションはつけず削除する方に倒した

@shimomuh shimomuh merged commit 0946427 into master May 5, 2018
@shimomuh shimomuh deleted the feature/upgrade-node-modules-and-enable-postcss branch May 5, 2018 17:52
This was referenced May 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant