æè¿ã¯ããã£ã±ãNext.jsã使ã£ã¦Webãµã¤ããå¶ä½ããããElectronã¨çµã¿åããã¦Macã¢ããªãå¶ä½ããããã¦ãã¾ãã
ãã©ã¤ãã®Webãµã¤ãã§ãããNext.jsãéçãµã¤ãã¸ã§ãã¬ã¼ã¿ã¨ãã¦ä½¿ã£ã¦ããã®ã§ããããã©ã¤ãã®ãµã¤ãã§ããã°ãNext.jsãReactãä¸è¦ãªã®ã§ã¯ãªãã®ãã¨æããViteã®èª¿æ»ãã¯ããã¾ããã
ç®æ¨ã¨ãã¦ã¯ãTypeScriptã¨SCSSã使ããç°å¢ããããã£ã¨æ§ç¯ãããã¨ã§ãã
TypeScript + SCSSã®ããã¸ã§ã¯ãã®ä½ææé
ⶠviteã®ããã¸ã§ã¯ããä½æ
yarn create vite
å®è¡å¾ã対話å¼ã®è³ªåã«å¿ããã
- Project name â ããã¸ã§ã¯ãåãå ¥å
- Select a framework â Vanillaãé¸æ
- Select a variant â TypeScriptãé¸æ
â· sass-embeddedã®å°å ¥
cd ããã¸ã§ã¯ãå
ã§ããã£ã¬ã¯ããªç§»åå¾ã
yarn add -D sass-embedded
ãå®è¡ã
⸠ãã¡ã¤ã«ããªãã¼ã
src/style.css ã src/style.scss ã«ãªãã¼ã
â¹ ã½ã¼ã¹ãç·¨é
src/main.ts
// import './style.css' // â åé¤ import './style.scss' // â 追å import typescriptLogo from './typescript.svg' import viteLogo from '/vite.svg' import { setupCounter } from './counter.ts' document.querySelector<HTMLDivElement>('#app')!.innerHTML = ` <div> <a href="https://vite.dev" target="_blank"> <img src="${viteLogo}" class="logo" alt="Vite logo" /> </a> <a href="https://www.typescriptlang.org/" target="_blank"> <img src="${typescriptLogo}" class="logo vanilla" alt="TypeScript logo" /> </a> <h1>Vite + TypeScript</h1> <div class="card"> <button id="counter" type="button"></button> </div> <p class="read-the-docs"> Click on the Vite and TypeScript logos to learn more </p> </div> ` setupCounter(document.querySelector<HTMLButtonElement>('#counter')!)
⺠éçºãµã¼ããèµ·å
yarn dev
ããã ãã§ãTypeScriptã¨SCSSã使ã£ãéçºãã§ãã¾ãã
é常ã«æ軽ã§ãã