Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
初めての create-react-app へ
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Asuka Wang
December 11, 2020
Programming
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
初めての create-react-app へ
Asuka Wang
December 11, 2020
Other Decks in Programming
See All in Programming
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
380
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
250
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
4
410
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
330
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
110
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
410
AHC070解法紹介
eijirou
0
150
Are APIs Still Relevant in the AI Era?
soyuka
0
390
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
Featured
See All Featured
Scaling GitHub
holman
464
140k
エンジニアに許された特別な時間の終わり
watany
109
250k
How to build a perfect <img>
jonoalderson
1
6.1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
600
New Earth Scene 8
popppiees
4
2.6k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Faster Mobile Websites
deanohume
310
32k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
290
Are puppies a ranking factor?
jonoalderson
2
4k
WENDY [Excerpt]
tessaabrams
14
40k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Transcript
asukachikaru ॳΊͯͷ create-react-app
About me • @asukachikaru • ग़ • झຯɿϒϩάͱϙʔτϑΥϦΦαΠτͷॻ͖͠ ɹɹɹesports ɹɹɹήʔϜ
͖͔͚ͬ React ਓؾ React ײ 8% 12% 8% 72% ܦݧ͋Γɺڵຯ͋Γ
ܦݧ͋Γɺڵຯͳ͠ ܦݧͳ͠ɺڵຯ͋Γ ܦݧͳ͠ɺڵຯͳ͠ Ref: state of js 2019 https://2019.stateofjs.com/front-end-frameworks/ Front-end framework ຬ 0% 22.5% 45% 67.5% 90% 38% 78% 87% 88% 89% React Svelte Vue Preact Angular
͖͔͚ͬ React ·Ͱͷಓ͕͔ͬͨ
͖͔͚ͬ ΞυόΠεΛΒͬͨ • ʮॳ৺ऀͩͬͨΒ create-react-app Ͱ͍͍͡Όͳ͍ʯ • ͦΕ͔ΒͤʹΒ͠·ͨ͠ͱ͞ɻΊͰͨ͠ΊͰͨ͠ • create-react-app
ͷίϯϑΥʔτκʔϯ͔Βग़ͨ͘ͳͬͨ·Ͱ
npm run eject • TL;DR: ͓͢͢Ί͠ͳ͍ (લఏ͋Γ) • create-react-app default
script • ύοΫ͞Ε͍ͯΔ babel, webpack, env ͳͲͷઃఆΛղ์ • ෆՄٯత
npm run eject
npm run eject • npm script ίϚϯυͰͳ͘ script ϑΝΠϧͰ start
build Λ࣮ߦ • ·ͩ create-react-app ͷείʔϓ͔ΒΕ͍ͯͳ͍ • ΑΓϓϩδΣΫτΛίϯτϩʔϧ͍ͨ͠ਓʹର͓ͯ͢͢͠Ί͠ͳ͍
Do it from scratch • ࣗͰ react Λ build ͢ΔڥΛઃఆ
• TL;DR: ͓͢͢Ί
Do it from scratch Architecture
Do it from scratch Dependencies • react • react-dom •
webpack • webpack-cli • @babel/core • @babel/preset-react • babel-loader
Do it from scratch HTML template node_mobules public index.html favicon.ico
… src components/ utils/ … App.jsx index.js package.json webpack.config.js .babelrc … <!DOCTYPE HTML> <html> <head> <title>Not built by create-react-app</title> … </head> <body> </body> </html> <div id="app-root"></div> <script src=“react.bundle.js"></script>
Do it from scratch Basic React App node_mobules public index.html
favicon.ico … src components/ utils/ … App.jsx index.js package.json webpack.config.js .babelrc … import React from "react"; const App = () => { return ( <div> Hello, world! </div>; }; export default App; const time = new Date().toLocaleTimeString(); <br /> {time}
Do it from scratch React entry node_mobules public index.html favicon.ico
… src components/ utils/ … App.jsx index.js package.json webpack.config.js .babelrc … import React from "react"; import ReactDOM from "react-dom"; import App from "./App"; ReactDOM.render( <App />, document.getElementById("app-root") );
Do it from scratch webpack config node_mobules public index.html favicon.ico
… src components/ utils/ … App.jsx index.js package.json webpack.config.js .babelrc … const path = require("path"); const webpackConfig = { mode: "development", entry: "./src/index.js", output: { path: path.resolve(__dirname, "build"), filename: "react.bundle.js", }, module: { rules: [ { test: /\.jsx?$/, exclude: /node_modules/, use: "babel-loader", }, ], }, ..
Do it from scratch webpack config node_mobules public index.html favicon.ico
… src components/ utils/ … App.jsx index.js package.json webpack.config.js .babelrc … .. resolve: { extensions: [".js", ".jsx", ".json"], }, devServer: { contentBase: path.resolve(__dirname, “public"), port: 3000, }, }; module.exports = webpackConfig;
Do it from scratch Babel config node_mobules public index.html favicon.ico
… src components/ utils/ … App.jsx index.js package.json webpack.config.js .babelrc … { "presets": ["@babel/preset-react"] }
Do it from scratch npm script commands build static react.bundle.js
index.html node_mobules public index.html favicon.ico … src components/ utils/ … App.jsx index.js package.json webpack.config.js .babelrc … npm start: webpack —-mode development serve npm build: webpack —-mode production —-config webpack.config.js \ && cp ./public/* ./build
End This is just the beginning.
This is just the beginning • CSS Loader / CSS-in-JS
• Env variables • Optimizer • SSR • TypeScript • ….
End.