Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vercel monorepo対策 / Vercel monorepo

OKUNOKENTARO
September 19, 2021

Vercel monorepo対策 / Vercel monorepo

2021年9月19日の発表で使用した資料です。

OKUNOKENTARO

September 19, 2021
Tweet

More Decks by OKUNOKENTARO

Other Decks in Technology

Transcript

  1. .POPSFQP w Ϟϊ Ϩϙ w NPOP઀಄ࣙ ʢϞϊΫϩɺ Ϟϊϩʔάɺ ϞϊϙϦʔʜʣ 

    w ͻͱͭͷ3FQPTJUPSZͰෳ਺ͷύοέʔδΛ؅ཧ͢Δ͜ͱ w ਖ਼௚࿩ऀʹΑͬͯࢦͯ͠Δཻ౓͕ҧ͏ w ྫ ɿ ϝϧΧϦ4IPQTͷϞϊ Ϩϙ w ྫ ɿ OQNͰͷ044ʹ͓͚ΔϞϊ Ϩϙ
  2. Α ͘ ͋Δڞ௨Խ໰୊ w 3FQPʹ"QQ" "QQ#͕͋ͬͨͱͯ͠ɺ  w "ͱ#ͷڞ௨ίʔ υ͸Ͳ͏͢Δ

    ʁ  w ྫ͑͹ϩάΠϯॲཧ͸ɺ ؀ڥม਺ͷҧ͍͚ͩͰ࢒Γͷϑϩʔ͸͢΂ͯҰॹ w ؀ڥม਺͚ͩҾ਺Խͯ͠ɺ ͋ͱ͸ؔ਺ʹ͍ͨ͠ w Ͳ͜ʹஔ͘ ʁ
  3. 6OJWFSTBMσΟ ϨΫ τ Ϧ w "QQ" "QQ#ͱܑఋͷσΟ ϨΫ τ Ϧ

    ͱͯ͠VOJWFSTBMΛஔ͘ w ./app-a ./app-b ./universalΈ͍ͨʹͳΔ w ൵͍͜͠ͱʹ͜Ε͸·ͬͨ͘ಈ͔ͳ͍ w 8FCQBDL͸ΞϓϦέʔγϣϯͷϧʔ τΑ Γ਌Λࢀর͢Δ͜ͱ͕Ͱ͖ͳ͍ w DPO fi HͰରࡦ͢Δ
  4. OFYUDPO fi HKT module.exports = { webpack: (config) => {

    const tsRule = config.module.rules.find((v) => v.test ? . toString().includes("ts") ); // app ΑΓ্ͷσΟϨΫτϦʹ͋Δ universal Λऔಘ͢ΔͨΊʹઃఆ const projectRoot = path .parse( __ filename) .dir.split(path.sep) .slice(0, -1) .join(path.sep); tsRule.include.push(projectRoot); return config; }, };