{"id":2196,"date":"2019-09-24T11:00:07","date_gmt":"2019-09-24T02:00:07","guid":{"rendered":"https:\/\/blog.ymyzk.com\/?p=2196"},"modified":"2019-09-23T23:14:16","modified_gmt":"2019-09-23T14:14:16","slug":"using-neutrino-for-setting-up-modern-frontend-development-environment","status":"publish","type":"post","link":"https:\/\/blog.ymyzk.com\/2019\/09\/using-neutrino-for-setting-up-modern-frontend-development-environment\/","title":{"rendered":"\u30e2\u30c0\u30f3\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u958b\u767a\u74b0\u5883\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b Neutrino \u3092\u5229\u7528\u3057\u3066\u307f\u305f\u8a71"},"content":{"rendered":"\n
mypy Playgroud<\/a> \u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306f\u3053\u308c\u307e\u3067\u751f\u306e (\u30c8\u30e9\u30f3\u30b9\u30d1\u30a4\u30eb\u7b49\u3092\u3059\u308b\u3053\u3068\u306e\u306a\u3044) JavaScript \u3068 jQuery \u7b49\u306e\u3044\u304f\u3064\u304b\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3057\u305f\uff0e\u4eca\u5f8c\u306e\u6a5f\u80fd\u8ffd\u52a0\u7b49\u3092\u8003\u616e\u3059\u308b\u3068\u3053\u306e\u307e\u307e\u958b\u767a\u3092\u7d9a\u3051\u3066\u3044\u304f\u306e\u306f\u9762\u5012\u3060\u3068\u611f\u3058\u305f\u305f\u3081\uff0c\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u90e8\u5206\u3092 React \u3067\u66f8\u304d\u76f4\u3059\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0e<\/p>\n\n\n\n \u5f53\u521d\u306f React \u958b\u767a\u74b0\u5883\u306e\u6574\u5099\u306b Create React App<\/a> \u3092\u5229\u7528\u3059\u308b\u3064\u3082\u308a\u3067\u3044\u307e\u3057\u305f\u304c\uff0c\u4eca\u56de\u306e\u76ee\u7684\u306b\u3088\u308a\u9069\u3057\u3066\u3044\u305d\u3046\u306a Neutrino<\/a> \u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0eNeutrino \u306e\u30e6\u30fc\u30b6\u30fc\u4f53\u9a13\u304c\u826f\u304b\u3063\u305f\u3082\u306e\u306e\u65e5\u672c\u8a9e\u306e\u8a18\u4e8b\u304c\u898b\u5f53\u305f\u3089\u306a\u304b\u3063\u305f\u305f\u3081\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n\n\n\n\n Neutrino \u306f\u30e2\u30c0\u30f3\u306a Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u74b0\u5883\u3092\u7c21\u5358\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u67d4\u8edf\u306a\u30c4\u30fc\u30eb\u3067\u3059\uff0e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u59cb\u3081\u308b\u969b\u306b\u9762\u5012\u306a webpack \u306e\u8a2d\u5b9a\u306e\u8a18\u8ff0\u306a\u3069\u3092\u884c\u3046\u3053\u3068\u306a\u304f\uff0c\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3067\u958b\u767a\u3092\u30b9\u30bf\u30fc\u30c8\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u308c\u307e\u3059\uff0e<\/p>\n\n\n\n Neutrino \u306f\u30dc\u30a4\u30e9\u30fc\u30d7\u30ec\u30fc\u30c8\u3092\u751f\u6210\u3059\u308b\u306e\u3067\u306f\u306a\u304f Neutrino \u672c\u4f53\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 + \u30d7\u30ea\u30bb\u30c3\u30c8\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 + \u30e6\u30fc\u30b6\u30fc\u306b\u3088\u308b\u30ab\u30b9\u30bf\u30e0\u8a2d\u5b9a + \u30e6\u30fc\u30b6\u30fc\u306e\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3068\u3044\u3046\u69cb\u6210\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff0e\u3053\u306e\u305f\u3081\uff0c\u6a5f\u80fd\u306e\u8ffd\u52a0\u3084\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u30d7\u30ea\u30bb\u30c3\u30c8\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30fb\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3067\u7c21\u5358\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n\n\n\n Neutrino \u306e\u30d7\u30ea\u30bb\u30c3\u30c8\u306f\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u63d0\u4f9b\u306e\u3082\u306e\u3082\u542b\u3081\u69d8\u3005\u306a\u3082\u306e\u304c npm \u306b\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059<\/a>\uff0e\u3053\u306e\u305f\u3081 React \u3092\u7528\u3044\u305f Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3060\u3051\u3067\u306f\u306a\u304f\uff0c\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u4f5c\u6210\u306b\u3082\u5229\u7528\u3067\u304d\u307e\u3059\uff0e\u307e\u305f React\u30fbPreact\u30fbVue \u306a\u3069\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084 Karma\u30fbMocha\u30fbJest \u306a\u3069\u306e\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u9078\u629e\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n\n\n\n Neutrino \u3067 React \u3092\u4f7f\u3063\u305f Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3059\uff0e\u307e\u305a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\uff0c\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5c0e\u5165\u3057\u307e\u3059:<\/p>\n\n\n\n \u6b21\u306b \u6700\u5f8c\u306b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u958b\u767a\u7528\u306e\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3057 <\/a>http:\/\/localhost:5000<\/a> \u304b\u3089\u51fa\u529b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff0e<\/p>\n\n\n\n Create React App \u306f Facebook \u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3053\u3068\u3082\u3042\u308a\uff0cReact \u3092\u7528\u3044\u305f\u958b\u767a\u74b0\u5883\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u5e83\u304f\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u304c\uff0c\u3044\u304f\u3064\u304b\u6b20\u70b9\u304c\u3042\u308a\u307e\u3059\uff0e<\/p>\n\n\n\n \u57fa\u672c\u7684\u306b Neutrino \u306e\u65b9\u304c\u3088\u308a\u67d4\u8edf\u306a\u30c4\u30fc\u30eb\u3068\u8a00\u3048\u305d\u3046\u3067\u3059\u304c\uff0c\u521d\u671f\u8a2d\u5b9a\u3059\u308b\u969b\u306b\u82e5\u5e72\u591a\u304f\u306e\u77e5\u8b58\u3092\u8981\u6c42\u3059\u308b\u3068\u8a00\u3048\u305d\u3046\u3067\u3059\uff0e\u3061\u306a\u307f\u306b Neutrino \u306f create-react-app \u306e README \u3067\u305d\u306e\u4ee3\u66ff\u3068\u3057\u3066\u3082\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059<\/a>\uff0e<\/p>\n\n\n\n \u30e2\u30c0\u30f3\u306a Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u74b0\u5883\u3092\u7c21\u5358\u306b\u6574\u5099\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30c4\u30fc\u30eb Neutrino \u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3057\u305f\uff0e\u307e\u305f Create React App \u3068\u306e\u7c21\u5358\u306a\u6bd4\u8f03\u3082\u884c\u3044\u307e\u3057\u305f\uff0eCreate React App \u306b\u4e0d\u6e80\u304c\u3042\u308b\u5834\u5408\u306f Neutrino \u3092\u4ee3\u66ff\u3068\u3057\u3066\u691c\u8a0e\u3057\u3066\u307f\u3066\u3082\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e<\/p>\n\n\n\nNeutrino \u3068\u306f<\/h2>\n\n\n\n
Neutrino \u306e\u7279\u5fb4<\/h2>\n\n\n\n
Neutrino + React \u3067\u306e Hello World<\/h2>\n\n\n\n
$ npm init\n$ npm add --save react react-dom\n$ npm add --save-dev neutrino @neutrinojs\/react<\/code><\/pre>\n\n\n\n
src\/index.jsx<\/code> \u306b React \u3067 hello world \u3092\u63cf\u753b\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3059\uff0e<\/p>\n\n\n\n
import { render } from 'react-dom';\n\nrender(<h1>Hello world!<\/h1>, document.getElementById('root'));<\/code><\/pre>\n\n\n\n
$ npx neutrino start --use @neutrinojs\/react<\/code><\/pre>\n\n\n\n
Create React App \u3068\u306e\u6bd4\u8f03<\/h2>\n\n\n\n
\u307e\u3068\u3081<\/h2>\n\n\n\n