1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1930],{1930:function(n,e,s){s.r(e),s.d(e,{default:function(){return l}});var a=s(2540),c=s(9710);function t(n){const e={a:"a",aside:"aside",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...(0,c.R)(),...n.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(e.p,{children:["Webpack 5.107ì´ ì¶ìëììµëë¤. ì´ë² 릴리ì¤ì íµì¬ì webpack coreìì ",(0,a.jsx)(e.code,{children:".html"})," íì¼ì ë¤ì´í°ë¸íê² ì²ë¦¬í기 ìí 첫 ë¨ê³ì
ëë¤. ì´ì JSìì HTML íì¼ì importíë©´ ê·¸ ìì ",(0,a.jsx)(e.code,{children:"<img src>"}),", ",(0,a.jsx)(e.code,{children:"<link href>"}),", ì¸ë¼ì¸ ",(0,a.jsx)(e.code,{children:"<style>"}),", ",(0,a.jsx)(e.code,{children:"<script src>"})," ì°¸ì¡°ê° ì¼ë°ì ì¸ webpack pipelineì íµí´ í´ìëë©°, ì¤ë«ëì ",(0,a.jsx)(e.code,{children:"html-loader"}),"ê° ë§¡ìì¤ë ìí ì ëì²´í기 ììí©ëë¤. HTML entry points(",(0,a.jsx)(e.code,{children:"html-webpack-plugin"}),"ì´ ë´ë¹íë ë¶ë¶)ë ìì§ 5.107ì í¬í¨ëì§ ììê³ , ë¤ì ë§ì´ë 릴리ì¤ìì ëì
ë ìì ì
ëë¤."]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ë² 릴리ì¤ìë Node.jsì ë´ì¥ type-stripping 기ë¥ì íì©íë ì¤íì TypeScript ì§ìë í¬í¨ëììµëë¤. ëë¶ì ë¨ìí TypeScript íë¡ì í¸ë¼ë©´ ",(0,a.jsx)(e.code,{children:"ts-loader"}),"ë ",(0,a.jsx)(e.code,{children:"swc-loader"})," ìì´ë ì»´íì¼í ì ììµëë¤."]}),"\n",(0,a.jsx)(e.p,{children:"ë ê¸°ë¥ ëª¨ë experimentalì´ë©° opt-in flag ë¤ì ì¨ê²¨ì ¸ ìì§ë§, ë°©í¥ì±ì ë¶ëª
í©ëë¤. ê²°êµìë HTML, CSS, 기본ì ì¸ TypeScript를 ì²ë¦¬í기 ìí´ ì¶ê° loaderë plugin ìì´ ìì í ì¹ ì±ì ë¹ëí ì ìê² íë ¤ë ê²ì
ëë¤."}),"\n",(0,a.jsx)(e.p,{children:"ì´ë¬í ì¤íì ìì
ê³¼ í¨ê», ì´ë² 릴리ì¤ììë ë´ì¥ CSS pipelineë ê³ì ì±ìí´ì§ê³ ìì¼ë©°, tree shaking, deferred imports, module resolutionìë ì¬ë¬ ê°ì ì¬íì´ í¬í¨ëììµëë¤."}),"\n",(0,a.jsx)(e.p,{children:"ì´ë² 릴리ì¤ì ìë¡ì´ 기ë¥ì ì´í´ë³´ì¸ì:"}),"\n",(0,a.jsxs)(e.ul,{children:["\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.a,{href:"#html-modules-experimental",children:(0,a.jsx)(e.strong,{children:"HTML Modules (Experimental)"})}),"\n",(0,a.jsxs)(e.ul,{children:["\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#experimentshtml-flag",children:[(0,a.jsx)(e.code,{children:"experiments.html"})," íëê·¸"]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#inline-style-tags",children:["ì¸ë¼ì¸ ",(0,a.jsx)(e.code,{children:"<style>"})," íê·¸"]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#inline-script-tags",children:["ì¸ë¼ì¸ ",(0,a.jsx)(e.code,{children:"<script>"})," íê·¸"]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#script-src-and-link-relmodulepreload",children:[(0,a.jsx)(e.code,{children:"<script src>"}),"ì ",(0,a.jsx)(e.code,{children:'<link rel="modulepreload">'})]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#webpackignore-magic-comment",children:[(0,a.jsx)(e.code,{children:"webpackIgnore"})," ë§¤ì§ ì½ë©í¸"]})}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsx)(e.a,{href:"#typescript-support-experimental",children:(0,a.jsx)(e.strong,{children:"TypeScript Support (Experimental)"})})}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.a,{href:"#css-improvements",children:(0,a.jsx)(e.strong,{children:"CSS Improvements"})}),"\n",(0,a.jsxs)(e.ul,{children:["\n",(0,a.jsx)(e.li,{children:(0,a.jsx)(e.a,{href:"#scope-hoisting-for-css-modules",children:"CSS Modules를 ìí Scope Hoisting"})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsx)(e.a,{href:"#pure-mode-for-css-modules",children:"CSS Modules를 ìí Pure Mode"})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#value-in-urls-and-import",children:[(0,a.jsx)(e.code,{children:"@import"}),"ì URLììì ",(0,a.jsx)(e.code,{children:"@value"})]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#multiple-aliases-via-exportsconvention",children:[(0,a.jsx)(e.code,{children:"exportsConvention"}),"ì íµí ì¬ë¬ ë³ì¹"]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#linkinsert-hook",children:[(0,a.jsx)(e.code,{children:"linkInsert"})," hook"]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#ordermodules-hook",children:[(0,a.jsx)(e.code,{children:"orderModules"})," hook"]})}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.a,{href:"#javascript-and-esm",children:(0,a.jsx)(e.strong,{children:"JavaScript and ESM"})}),"\n",(0,a.jsxs)(e.ul,{children:["\n",(0,a.jsx)(e.li,{children:(0,a.jsx)(e.a,{href:"#anonymous-default-export-naming",children:"ìµëª
default export ì´ë¦ ì§ì "})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#preserving-defer-and-source-phase-on-externals",children:["externalsìì ",(0,a.jsx)(e.code,{children:"defer"}),"ì ",(0,a.jsx)(e.code,{children:"source"})," phase ì ì§"]})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsxs)(e.a,{href:"#__no_side_effects__-annotation",children:[(0,a.jsx)(e.code,{children:"#__NO_SIDE_EFFECTS__"})," annotation"]})}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsx)(e.a,{href:"#resolver-updates",children:(0,a.jsx)(e.strong,{children:"Resolver Updates"})})}),"\n",(0,a.jsx)(e.li,{children:(0,a.jsx)(e.a,{href:"#bug-fixes",children:(0,a.jsx)(e.strong,{children:"Bug Fixes"})})}),"\n"]}),"\n",(0,a.jsxs)(e.h2,{children:[(0,a.jsx)(e.span,{id:"html-modules-experimental"}),"HTML Modules (Experimental)",(0,a.jsx)(e.a,{href:"#html-modules-experimental","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.aside,{className:"warning",children:[(0,a.jsx)(e.p,{className:"warning__prefix",children:"warning"}),(0,a.jsxs)(e.p,{children:[(0,a.jsx)(e.strong,{children:"ì´ ê¸°ë¥ì experimentalì´ë©° ìì§ ì¼ë¶ë§ 구íëì´ ììµëë¤."})," Webpack 5.107ì íì¬ ",(0,a.jsx)(e.code,{children:"html-loader"}),"ê° ë´ë¹íë ë¶ë¶ë§ 구íí©ëë¤. ì¦, JavaScriptìì HTML íì¼ì
1 importíë©´ ê·¸ ìì íê·¸ ì°¸ì¡°ê° webpack pipelineì íµí´ ì²ë¦¬ë©ëë¤. ",(0,a.jsx)(e.strong,{children:"HTML entry points"}),"(",(0,a.jsx)(e.code,{children:".html"})," íì¼ì ",(0,a.jsx)(e.code,{children:"entry"}),"ë¡ ì§ì ì¬ì©íë ë°©ì, ì¦ ",(0,a.jsx)(e.code,{children:"html-webpack-plugin"}),"ì´ ë§¡ë ë¶ë¶)ë ",(0,a.jsx)(e.strong,{children:"ìì§ ì§ìëì§ ìì¼ë©°"}),", ë¤ì ë§ì´ë 릴리ì¤ìì ëì
ë ìì ì
ëë¤. ì ì²´ ìì
ì ì´ì ",(0,a.jsx)(e.a,{href:"https://github.com/webpack/webpack/issues/536",children:"#536"}),"ìì ì¶ì ëê³ ììµëë¤."]})]}),"\n",(0,a.jsxs)(e.p,{children:["ì¤ì webpack ì¤ì ìì HTML entry point를 ì¬ì©íë ¤ë©´ ìì¬ì ì¼ë¡ ìµì ë ê°ì ì¶ê° ìì¡´ì±ì´ íìíìµëë¤. íëë HTML íì¼ì ìì±íê±°ë ì¶ë ¥íê³ ì¬ê¸°ì ì¬ë°ë¥¸ ë²ë¤ URLì 주ì
í´ ì£¼ë ",(0,a.jsx)(e.code,{children:"html-webpack-plugin"}),"ì
ëë¤. ë¤ë¥¸ íëë ",(0,a.jsx)(e.code,{children:"<img src>"}),", ",(0,a.jsx)(e.code,{children:"<link href>"}),", ",(0,a.jsx)(e.code,{children:"<script src>"})," ë±ì 참조를 webpackì´ ìíí ì ìê² í´, ì´ ì°¸ì¡°ë¤ì´ ì¼ë°ì ì¸ resolver ë° asset pipelineì ê±°ì¹ê² í´ ì£¼ë ",(0,a.jsx)(e.code,{children:"html-loader"}),"ì
ëë¤."]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ ë ë구ë ì¤ë«ëì 커뮤ëí°ì í° ëìì´ ëìì§ë§, core ë°ê¹¥ì ì¡´ì¬í´ ììµëë¤. Webpack 5.107ì ì´ì ì´ ìì
ì¤ ",(0,a.jsx)(e.code,{children:"html-loader"}),"ê° ë§¡ë ë¶ë¶ì core ìì¼ë¡ ê°ì ¸ì¤ê¸° ììí©ëë¤."]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"experimentshtml-flag"}),(0,a.jsx)(e.code,{children:"experiments.html"})," Flag",(0,a.jsx)(e.a,{href:"#experimentshtml-flag","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ ì¹ì
ì ëë¨¸ì§ ê¸°ë¥ì 모ë íëì opt-in flag ë¤ì ììµëë¤. ìë¡ì´ ",(0,a.jsx)(e.code,{children:"experiments.html"})," ìµì
ì ",(0,a.jsx)(e.code,{children:"NormalModuleFactory"}),"ì ",(0,a.jsx)(e.code,{children:"html"})," module typeì ë±ë¡íê³ , ìëìì ì¤ëª
íë HTML ëìì íì±íí©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// webpack.config.js"}),"\nmodule",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"experiments"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"html"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsx)(e.p,{children:"ê·¸ë¤ì JavaScriptìì HTML íì¼ì importí©ëë¤. default exportë ì²ë¦¬ë HTML 문ìì´ì´ë©°, 모ë asset 참조ë webpackì íµí´ í´ìë©ëë¤."}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// src/index.js"}),"\n",(0,a.jsx)(e.span,{className:"token keyword",children:"import"})," page ",(0,a.jsx)(e.span,{className:"token keyword",children:"from"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./page.html"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\ndocument",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"documentElement",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"innerHTML ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," page",(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.p,{children:["ì´ ê²°ê³¼ë¬¼ì ííë ",(0,a.jsx)(e.code,{children:"html-loader"}),"ê° ìì±íë ê²ê³¼ ëì¼íë¯ë¡, HTMLì importíë 기존 ì½ëë ê³ì ëìí´ì¼ í©ëë¤. ì´ì loaderê° íë ì¼ì pipelineì´ ì§ì ìíí©ëë¤. íê·¸ 참조ë í´ìëê³ , í´ìë íì¼ ì´ë¦ì ë¤ì HTML 문ìì´ ìì ë°ìëë©°, ìµì¢
ê²°ê³¼ë JS ë²ë¤ì í¬í¨ë©ëë¤. ",(0,a.jsx)(e.code,{children:".html"}
1)," íì¼ì webpack ",(0,a.jsx)(e.code,{children:"entry"}),"ë¡ ì§ì ì¬ì©íë ê²ì 5.107ìì ",(0,a.jsx)(e.strong,{children:"ì§ìëì§ ììµëë¤"}),"."]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"inline-style-tags"}),"Inline ",(0,a.jsx)(e.code,{children:"<style>"})," Tags",(0,a.jsx)(e.a,{href:"#inline-style-tags","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["webpackì´ HTML module ë´ë¶ìì ",(0,a.jsx)(e.code,{children:"<style>"})," ë¸ë¡ì ë°ê²¬íë©´, ê·¸ CSS 본문ì ",(0,a.jsx)(e.code,{children:".css"})," íì¼ì ì¬ì©íë ê²ê³¼ ëì¼í CSS pipelineì¼ë¡ ì ë¬í©ëë¤. ì´ ë¸ë¡ì ",(0,a.jsx)(e.code,{children:'exportType: "text"'}),"를 ê°ë ê°ì CSS moduleë¡ ì²ë¦¬ëë¯ë¡, ì¤íì¼ ë´ë¶ì ",(0,a.jsx)(e.code,{children:"url()"})," 참조ì ",(0,a.jsx)(e.code,{children:"@import"})," 구문ì HTML íì¼ì 기ì¤ì¼ë¡ í´ìë©ëë¤. ì²ë¦¬ê° ëëë©´ ë³íë CSSê° ì¶ë ¥ HTML 문ìì´ì ìë ",(0,a.jsx)(e.code,{children:"<style>"})," íê·¸ ìì ë¤ì 기ë¡ë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-html",children:[(0,a.jsx)(e.span,{className:"token comment",children:"\x3c!-- src/page.html --\x3e"}),"\n",(0,a.jsxs)(e.span,{className:"token doctype",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<!"}),(0,a.jsx)(e.span,{className:"token doctype-tag",children:"doctype"})," ",(0,a.jsx)(e.span,{className:"token name",children:"html"}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"html"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"head"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"style"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),'\n @import "./reset.css";\n\n body {\n background: url("./bg.png");\n }\n ',(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"style"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"head"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"body"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ...\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"body"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"html"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]})]})}),"\n",(0,a.jsxs)(e.p,{children:[(0,a.jsx)(e.code,{children:'<style type="text/css">'}),"ì ",(0,a.jsx)(e.code,{children:"type"})," ìì±ì´ ìë ",(0,a.jsx)(e.code,{children:"<style>"}),"ì ì²ë¦¬ë©ëë¤. CSSê° ìë ",(0,a.jsx)(e.code,{children:"type"}),"ì ê°ì§ ê²½ì°ìë ë³ê²½ ìì´ ê·¸ëë¡ íµê³¼í©ëë¤. ì´ë¥¼ íµí´ pipelineì ",(0,a.jsx)(e.code,{children:"html-loader"}),"를 ë£ì§ ììë ì¸ë¼ì¸ ì¤íì¼ ê´ë ¨ ëìì ì²ë¦¬í ì ììµëë¤."]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"inline-script-tags"}),"Inline ",(0,a.jsx)(e.code,{children:"<script>"})," Tags",(0,a.jsx)(e.a,{href:"#inline-script-tags","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ì¸ë¼ì¸ ",(0,a.jsx)(e.code,{children:"<script>"})," 본문ì ì´ë¯¸ ",(0,a.jsx)(e.code,{children:"<script src>"}),"를 ì²ë¦¬íë ê²ê³¼ ëì¼í entry pipelineì¼ë¡ ì ë¬ë©ëë¤. ê° ",(0,a.jsx)(e.code,{children:"<script>"})," 본문ì ê°ê°ì webpack entryê° ë©ëë¤. ì¼ë°ì ì¸ ì¸ë¼ì¸ ì¤í¬ë¦½í¸ë CommonJSë¡ ë²ë¤ë§ëê³ , ",(0,a.jsx)(e.code,{children:'<script type="module">'})," 본문ì ESMì¼ë¡ ë²ë¤ë§ë©ëë¤. ì¶ë ¥ë HTMLì íê·¸ë ìì±ë ì²í¬ë¥¼ ê°ë¦¬í¤ë ",(0,a.jsx)(e.code,{children:'<script src="...">'})," ííë¡ ë¤ì ìì±ëë©°, 본문ì ë¹ìì§ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-html",children:[(0,a.jsx)(e.span,{className:"token comment",children:"\x3c!-- src/page.html --\x3e"}),"\n",(0,a.jsxs)(e.span,{className:"token doctype",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<!"}),(0,a.jsx)(e.span,{className:"token doctype-tag",children:"doctype"})," ",(0,a.jsx)(e.span,{className:"token name",children:"html"}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"html"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"body"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"script"]})," ",(0,a.jsx)(e.span,{className:"token attr-name",children:"type"}),(0,a.jsxs)(e.span,{className:"token attr-value",children:[(0,a.jsx)(e.span,{className:"token punctuation attr-equals",children:"="}),(0,a.jsx)(e.span,{className:"token punctuation",children:'"'}),"module",(0,a.jsx)(e.span,{className:"token punctuation",children:'"'})]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),'\n import { greet } from "./lib.js";\n greet("world");\n ',(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"script"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"script"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),'\n console.log("classic inline script");\n ',(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"script"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"body"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"html"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]})]})}),"\n",(0,a.jsxs)(e.p,{children:["ì¸ë¶ ",(0,a.jsx)(e.code,{children:"<script src>"}),"ì ì ì©ëë ëìì ì¬ê¸°ìë ëì¼íê² ì ì©ë©ëë¤."]}),"\n",(0,a.jsxs)(e.ul,{children:["\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.code,{children:"output.module"}
1),"ì´ íì±íëì´ ìì¼ë©´, ì¼ë°ì ì¸ ì¸ë¼ì¸ ",(0,a.jsx)(e.code,{children:"<script>"})," íê·¸ë ",(0,a.jsx)(e.code,{children:"<script src>"}),"ììì ëìê³¼ ë§ì°¬ê°ì§ë¡ ìëì¼ë¡ ",(0,a.jsx)(e.code,{children:'type="module"'}),"ë¡ ì¹ê²©ë©ëë¤."]}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.code,{children:"webpackIgnore"}),"ë ì¸ë¼ì¸ ",(0,a.jsx)(e.code,{children:"<script>"})," íê·¸ììë ëìíë¯ë¡, ìë 본문ì ê·¸ëë¡ ì ì§í ì ììµëë¤."]}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.code,{children:"application/ld+json"}),"ì´ë ",(0,a.jsx)(e.code,{children:"importmap"}),"ì²ë¼ JavaScriptê° ìë ",(0,a.jsx)(e.code,{children:"type"})," ê°ì ë³ê²½ ìì´ ê·¸ëë¡ íµê³¼í©ëë¤."]}),"\n"]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"script-src-and-link-relmodulepreload"}),(0,a.jsx)(e.code,{children:"<script src>"})," and ",(0,a.jsx)(e.code,{children:'<link rel="modulepreload">'}),(0,a.jsx)(e.a,{href:"#script-src-and-link-relmodulepreload","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["HTML module ë´ë¶ì ",(0,a.jsx)(e.code,{children:"<script src>"}),"ì ",(0,a.jsx)(e.code,{children:'<link rel="modulepreload">'})," 참조ë ì¤ì webpack entryê° ëë©°, ì¶ë ¥ë ì²í¬ URLì´ ë¤ì HTML 문ìì´ì 기ë¡ëì´ í´ìë íì¼ ì´ë¦ë ì¬ë°ë¥´ê² ì ì§ë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-html",children:[(0,a.jsx)(e.span,{className:"token comment",children:"\x3c!-- src/page.html --\x3e"}),"\n",(0,a.jsxs)(e.span,{className:"token doctype",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<!"}),(0,a.jsx)(e.span,{className:"token doctype-tag",children:"doctype"})," ",(0,a.jsx)(e.span,{className:"token name",children:"html"}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"html"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"head"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"link"]})," ",(0,a.jsx)(e.span,{className:"token attr-name",children:"rel"}),(0,a.jsxs)(e.span,{className:"token attr-value",children:[(0,a.jsx)(e.span,{className:"token punctuation attr-equals",children:"="}),(0,a.jsx)(e.span,{className:"token punctuation",children:'"'}),"modulepreload",(0,a.jsx)(e.span,{className:"token punctuation",children:'"'})]})," ",(0,a.jsx)(e.span,{className:"token attr-name",children:"href"}),(0,a.jsxs)(e.span,{className:"token attr-value",children:[(0,a.jsx)(e.span,{className:"token punctuation attr-equals",children:"="}),(0,a.jsx)(e.span,{className:"token punctuation",children:'"'}),"./preloaded.js",(0,a.jsx)(e.span,{className:"token punctuation",children:'"'})]})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"/>"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"head"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"body"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"script"]})," ",(0,a.jsx)(e.span,{className:"token attr-name",children:"src"}),(0,a.jsxs)(e.span,{className:"token attr-value",children:[(0,a.jsx)(e.span,{className:"token punctuation attr-equals",children:"="}),(0,a.jsx)(e.span,{className:"token punctuation",children:'"'}),"./entry.js",(0,a.jsx)(e.span,{className:"token punctuation",children:'"'})]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"script"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"script"]})," ",(0,a.jsx)(e.span,{className:"token attr-name",children:"src"}),(0,a.jsxs)(e.span,{className:"token attr-value",children:[(0,a.jsx)(e.span,{className:"token punctuation attr-equals",children:"="}),(0,a.jsx)(e.span,{className:"token punctuation",children:'"'}),"./second.js",(0,a.jsx)(e.span,{className:"token punctuation",children:'"'})]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"script"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n ",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"body"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"html"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]})]})}),"\n",(0,a.jsx)(e.p,{children:"ììëë©´ ì¢ì ëìì ë¤ìê³¼ ê°ìµëë¤."}),"\n",(0,a.jsxs)(e.ul,{children:["\n",(0,a.jsxs)(e.li,{children:["ê°ì íì´ì§ì ì¬ë¬ ",(0,a.jsx)(e.code,{children:"<script src>"})," íê·¸ë íëì runtimeì ê³µì í©ëë¤. ê° ê·¸ë£¹(ì¼ë° ì¤í¬ë¦½í¸ ëë ",(0,a.jsx)(e.code,{children:'type="module"'}),") ììì ì ë íëª©ì´ runtimeì ë³´ì íê³ , ë머ì§ë ì¬ê¸°ì ",(0,a.jsx)(e.code,{children:"dependOn"}),"ì ì ì¸í©ëë¤."]}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.code,{children:'<link rel="modulepreload">'})," entryë ë
립ì ì¼ë¡ ì ì§ëë©° íì scriptìì importëì§ ììµëë¤. ë°ë¼ì ì¤íì´ ì구íë ëë¡ ì¤í ìì´ preloadë§ ìíí©ëë¤."]}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.code,{children:"output.module"}
1),"ì´ íì±íëì´ ìì¼ë©´, ì¼ë°ì ì¸ ",(0,a.jsx)(e.code,{children:"<script src>"})," íê·¸ë ì¶ë ¥ëë ES module ì²í¬ê° ì¬ë°ë¥¸ 모ëë¡ ë¡ëëëë¡ ",(0,a.jsx)(e.code,{children:'<script type="module" src>'}),"ë¡ ìë ì¹ê²©ë©ëë¤."]}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.code,{children:"application/ld+json"}),", ",(0,a.jsx)(e.code,{children:"importmap"})," ê°ì JavaScriptê° ìë script typeì´ë data URIë ë³ê²½ ìì´ ê·¸ëë¡ íµê³¼íë©° JSë¡ ë²ë¤ë§ëì§ ììµëë¤."]}),"\n"]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"webpackignore-magic-comment"}),(0,a.jsx)(e.code,{children:"webpackIgnore"})," Magic Comment",(0,a.jsx)(e.a,{href:"#webpackignore-magic-comment","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ìµìí ",(0,a.jsx)(e.code,{children:"webpackIgnore: true"})," ë§¤ì§ ì½ë©í¸ê° ì´ì HTML modules ë´ë¶ììë ëìí©ëë¤. íê·¸ ë°ë¡ ìì í´ë¹ ì§ìì´ê° ë¤ì´ ìë HTML comment를 ëë©´, webpackì ì¶ë ¥ ì í´ë¹ íê·¸ì URLì ê±´ëë¦¬ì§ ììµëë¤. ì´ë ",(0,a.jsx)(e.code,{children:"html-loader"}),"ê° ëì¼í ê²½ì°ë¥¼ ì²ë¦¬íë ë°©ìê³¼ ê°ìµëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-html",children:[(0,a.jsx)(e.span,{className:"token comment",children:"\x3c!-- webpackIgnore: true --\x3e"}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"img"]})," ",(0,a.jsx)(e.span,{className:"token attr-name",children:"src"}),(0,a.jsxs)(e.span,{className:"token attr-value",children:[(0,a.jsx)(e.span,{className:"token punctuation attr-equals",children:"="}),(0,a.jsx)(e.span,{className:"token punctuation",children:'"'}),"https://cdn.example.com/logo.png",(0,a.jsx)(e.span,{className:"token punctuation",children:'"'})]})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"/>"})]}),"\n\n",(0,a.jsx)(e.span,{className:"token comment",children:"\x3c!-- webpackIgnore: true --\x3e"}),"\n",(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"<"}),"script"]})," ",(0,a.jsx)(e.span,{className:"token attr-name",children:"src"}),(0,a.jsxs)(e.span,{className:"token attr-value",children:[(0,a.jsx)(e.span,{className:"token punctuation attr-equals",children:"="}),(0,a.jsx)(e.span,{className:"token punctuation",children:'"'}),"/legacy/external.js",(0,a.jsx)(e.span,{className:"token punctuation",children:'"'})]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]}),(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsxs)(e.span,{className:"token tag",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"</"}),"script"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:">"})]})]})}),"\n",(0,a.jsxs)(e.p,{children:["ì´ comment ê°ì JSì CSS parserê° ì¬ì©íë ê²ê³¼ ëì¼í 컨í
ì¤í¸ìì íì±ëë¯ë¡, booleanì´ ìë ê°ì ì¬ì©íë©´ ",(0,a.jsx)(e.code,{children:"UnsupportedFeatureWarning"}),"ì´ ë°ìí©ëë¤."]}),"\n",(0,a.jsxs)(e.h2,{children:[(0,a.jsx)(e.span,{id:"typescript-support-experimental"}),"TypeScript Support (Experimental)",(0,a.jsx)(e.a,{href:"#typescript-support-experimental","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.aside,{className:"warning",children:[(0,a.jsx)(e.p,{className:"warning__prefix",children:"warning"}),(0,a.jsxs)(e.p,{children:[(0,a.jsx)(e.strong,{children:"ì´ ê¸°ë¥ì experimentalì´ë©° ìµì Node.jsì ìì¡´í©ëë¤."})," ìì ì ì¸ ",(0,a.jsx)(e.code,{children:"module.stripTypeScriptTypes"})," API를 ì¬ì©íë ¤ë©´ Node.js 22.6 ì´ìì´ íìí©ëë¤. ëí ì´ ë³íì ì§ìì§ ì ìë TypeScript 문ë²ë§ ì²ë¦¬í©ëë¤(ìë ì í ì¬í ì°¸ê³ ). ê·¸ ì¸ì ê²½ì°ìë ê³ì ",(0,a.jsx)(e.code,{children:"ts-loader"}),"ë ",(0,a.jsx)(e.code,{children:"swc-loader"}),"를 ì¬ì©íì¸ì."]})]}),"\n",(0,a.jsxs)(e.p,{children:["Webpack 5.107ì ìë¡ì´ ",(0,a.jsx)(e.code,{children:"experiments.typescript"})," íëê·¸ ë¤ìì first-class TypeScript ì§ìì ì ê³µí©ëë¤. ì´ë¥¼ íì±ííë©´ webpackì Node.jsì ë´ì¥ ",(0,a.jsx)(e.a,{href:"https://nodejs.org/api/module.html#modulestriptypescripttypescode-options",children:(0,a.jsx)(e.code,{children:"module.stripTypeScriptTypes"})}),"를 íµí´ ",(0,a.jsx)(e.code,{children:".ts"}),", ",(0,a.jsx)(e.code,{children:".cts"}),", ",(0,a.jsx)(e.code,{children:".mts"}
1)," íì¼ì ì§ì ì»´íì¼íë©°, ì¸ë¶ loaderê° íìíì§ ììµëë¤. ì´ íëê·¸ë ",(0,a.jsx)(e.a,{href:"/configuration/experiments/#experimentsfuturedefaults",children:(0,a.jsx)(e.code,{children:"experiments.futureDefaults"})}),"를 ì¬ì©íë©´ ìëì¼ë¡ íì±íë기ë í©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// webpack.config.js"}),"\n",(0,a.jsx)(e.span,{className:"token keyword",children:"export"})," ",(0,a.jsx)(e.span,{className:"token keyword",children:"default"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"experiments"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"typescript"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"entry"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./src/index.ts"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.p,{children:["ì´ íë그를 íì±ííë©´ ëª ê°ì§ í©ë¦¬ì ì¸ ê¸°ë³¸ê°ë í¨ê» ì¤ì ë©ëë¤. ",(0,a.jsx)(e.code,{children:".ts"})," / ",(0,a.jsx)(e.code,{children:".cts"})," / ",(0,a.jsx)(e.code,{children:".mts"}),"ì© rules, ",(0,a.jsx)(e.code,{children:".js"}),"ë³´ë¤ ìì ",(0,a.jsx)(e.code,{children:".ts"}),"를 extension resolutionì ì¶ê°íë ëì, ",(0,a.jsx)(e.code,{children:'import "./foo.js"'}),"ê° ",(0,a.jsx)(e.code,{children:"./foo.ts"}),"ë ìëíê² íë ",(0,a.jsx)(e.code,{children:"extensionAlias"}),", ",(0,a.jsx)(e.code,{children:"tsconfig.json"})," í´ì, ê·¸ë¦¬ê³ ",(0,a.jsx)(e.code,{children:".ts"})," ìì¤ë¥¼ ë°°í¬íë monorepo를 ìí ",(0,a.jsx)(e.code,{children:'"typescript"'})," conditional exports key ì§ìì´ í¬í¨ë©ëë¤."]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ ë³íì ",(0,a.jsx)(e.strong,{children:"íì
ë§ ì ê±°"}),"í©ëë¤. type checkingì íì§ ìì¼ë©°, JSX / ",(0,a.jsx)(e.code,{children:".tsx"}),", ê·¸ë¦¬ê³ ì§ìì§ ì ìë 문ë²(",(0,a.jsx)(e.code,{children:"enum"}),", ",(0,a.jsx)(e.code,{children:"namespace"}),", parameter-property constructors, decorator metadata)ì ì§ìíì§ ììµëë¤. ì´ë TypeScriptì ",(0,a.jsx)(e.a,{href:"https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly",children:(0,a.jsx)(e.code,{children:"erasableSyntaxOnly"})}),"ì ëì¼í ì ì½ì
ëë¤. type checkingì´ íìíë¤ë©´ ",(0,a.jsx)(e.code,{children:"tsc --noEmit"}),"ì´ë ",(0,a.jsx)(e.a,{href:"https://github.com/TypeStrong/fork-ts-checker-webpack-plugin",children:(0,a.jsx)(e.code,{children:"fork-ts-checker-webpack-plugin"})}),"ì í¨ê» ì¬ì©íì¸ì. JSXë ì§ìì§ ì ìë 문ë²ì ì¬ì©íë¤ë©´ ê³ì ",(0,a.jsx)(e.code,{children:"ts-loader"}),"ë ",(0,a.jsx)(e.code,{children:"swc-loader"}),"를 ì¬ì©í´ì¼ í©ëë¤."]}),"\n",(0,a.jsxs)(e.p,{children:["ë´ì¥ ì¤ì ìì ë ",(0,a.jsx)(e.a,{href:"https://github.com/webpack/webpack/tree/main/examples/typescript",children:(0,a.jsx)(e.code,{children:"examples/typescript"})}),"ìì, ",(0,a.jsx)(e.code,{children:"ts-loader"})," fallback ìì ë ",(0,a.jsx)(e.a,{href:"https://github.com/webpack/webpack/tree/main/examples/typescript-non-erasable",children:(0,a.jsx)(e.code,{children:"examples/typescript-non-erasable"})}),"ìì íì¸í ì ììµëë¤."]}),"\n",(0,a.jsxs)(e.h2,{children:[(0,a.jsx)(e.span,{id:"css-improvements"}),"CSS Improvements",(0,a.jsx)(e.a,{href:"#css-improvements","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"scope-hoisting-for-css-modules"}),"Scope Hoisting for CSS Modules",(0,a.jsx)(e.a,{href:"#scope-hoisting-for-css-modules","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["Module concatenation(ì¼ë°ì ì¼ë¡ scope hoistingì´ë¼ê³ ë ë¶ë¦)ì ì´ì ê¹ì§ JavaScript ì ì© ìµì íììµëë¤. ",(0,a.jsx)(e.code,{children:"experiments.css"}),"를 íì±ííëë¼ë, ì°ê²°ë ë²ë¤ì í¬í¨ë CSS Modulesë ì¬ì í ë³ëì runtime ì¸ì¤í´ì¤ë¥¼ ìì±íìµëë¤. 5.107ë¶í°ë ",(0,a.jsx)(e.code,{children:"text"}),", ",(0,a.jsx)(e.code,{children:"css-style-sheet"}),", ",(0,a.jsx)(e.code,{children:"style"}),", ",(0,a.jsx)(e.code,{children:"link"}),"를 export typeì¼ë¡ ì¬ì©íë CSS Modulesìë ëì¼í ìµì íê° ì ì©ë©ëë¤. ê·¸ ê²°ê³¼ CSS ë¹ì¤ì´ í° ë²ë¤ìì runtime ì¤ë²í¤ëê° ì¤ê³ ì¶ë ¥ í¬ê¸°ë ë ììì§ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:["module",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"experiments"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"css"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"optimization"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"concatenateModules"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"module"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"rules"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"test"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsxs)(e.span,{className:"token regex",children:[(0,a.jsx)(e.span,{className:"token regex-delimiter",children:"/"}),(0,a.jsx)(e.span,{className:"token regex-source language-regex",children:"\\.css$"}),(0,a.jsx)(e.span,{className:"token regex-delimiter",children:"/"})]}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"type"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"css/module"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"parser"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"exportType"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"css-style-sheet"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"pure-mode-for-css-modules"}),"Pure Mode for CSS Modules",(0,a.jsx)(e.a,{href:"#pure-mode-for-css-modules","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:[(0,a.jsx)(e.code,{children:"css/module"}),"ê³¼ ",(0,a.jsx)(e.code,{children:"css/auto"}),"ìë ì´ì ìë¡ì´ ",(0,a.jsx)(e.code,{children:"pure"})," parser ìµì
ì´ ì¶ê°ëììµëë¤. ì´ë ",(0,a.jsx)(e.code,{children:"postcss-modules-local-by-default"}),"ì ì격í pure modeì ëì¼í ê°ë
ì
ëë¤. íì±ííë©´ 모ë selectorë ìµì íë
1ì local class ëë id를 í¬í¨í´ì¼ íë©°, ê·¸ë ì§ ìì¼ë©´ webpackì´ build error를 ë°ììíµëë¤. 목ì ì CSS Modules ììì ìëì¹ ìê² ì ì selector를 ìì±íë ì¤ì를 íë¡ëì
ì´ì ì ì¡ìë´ë ê²ì
ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:["module",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"experiments"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"css"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"module"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"parser"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token string-property property",children:'"css/module"'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"pure"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsx)(e.p,{children:"íìí ëë ë ê°ì§ commentë¡ ìì¸ë¥¼ ë ì ììµëë¤. 첫 ë²ì§¸ë ë¨ì¼ ruleì ëí´ìë§ ê²ì¬ë¥¼ ìµì í©ëë¤."}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-css",children:[(0,a.jsx)(e.span,{className:"token comment",children:"/* cssmodules-pure-ignore */"}),"\n",(0,a.jsx)(e.span,{className:"token selector",children:"a"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token comment",children:"/* ì´ ruleì ëí´ìë§ ê²ì¬ ìµì */"}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:"color"}),(0,a.jsx)(e.span,{className:"token punctuation",children:":"})," blue",(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"})]})}),"\n",(0,a.jsx)(e.p,{children:"ë ë²ì§¸ë íì¼ì ì´ë¤ ruleë³´ë¤ë ìì ìì¹í ì í comment ì¤ì ë°°ì¹íì ë, íì¼ ì ì²´ì ëí ê²ì¬ë¥¼ ë¹íì±íí©ëë¤."}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-css",children:[(0,a.jsx)(e.span,{className:"token comment",children:"/* cssmodules-pure-no-check */"}),"\n",(0,a.jsx)(e.span,{className:"token comment",children:"/* ì´ íì¼ì ëí´ pure mode를 ë¹íì±í */"}),"\n\n",(0,a.jsx)(e.span,{className:"token selector",children:"a"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token comment",children:"/* pure modeë¼ë©´ ë³´íµ ì¤í¨íì selector */"}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:"color"}),(0,a.jsx)(e.span,{className:"token punctuation",children:":"})," red",(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"})]})}),"\n",(0,a.jsxs)(e.p,{children:["local selector를 í¬í¨íë ìì ê·ì¹ ìì ì¤ì²© ê·ì¹ì pure를 ë§ì¡±íë ê²ì¼ë¡ ê°ì£¼ëê³ , ",(0,a.jsx)(e.code,{children:"&"}),"ë ë¶ëª¨ ê·ì¹ì purity를 ë°ë¥´ë©°, ",(0,a.jsx)(e.code,{children:"@keyframes"}),"ì ",(0,a.jsx)(e.code,{children:"@counter-style"})," 본문ì ìì¸ë¡ ì²ë¦¬ë©ëë¤."]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"value-in-urls-and-import"}),(0,a.jsx)(e.code,{children:"@value"})," in URLs and ",(0,a.jsx)(e.code,{children:"@import"}),(0,a.jsx)(e.a,{href:"#value-in-urls-and-import","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ì CSS Modulesì ",(0,a.jsx)(e.code,{children:"@value"})," ìë³ì를 ",(0,a.jsx)(e.code,{children:"@import"}),"ì ê²½ë¡ ì¸ìë ",(0,a.jsx)(e.code,{children:"url()"})," 참조 ë´ë¶ìì ì¬ì©í ì ììµëë¤. ëë¶ì ê³µíµ ê²½ë¡ì assetì í ë²ë§ ì ìí´ ëê³ ì¬ë¬ stylesheetìì ì¬ì¬ì©í기 ì¬ìì§ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-css",children:[(0,a.jsxs)(e.span,{className:"token atrule",children:[(0,a.jsx)(e.span,{className:"token rule",children:"@value"})," ",(0,a.jsx)(e.span,{className:"token property",children:"path"}),(0,a.jsx)(e.span,{className:"token punctuation",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./other.module.css"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]}),"\n",(0,a.jsxs)(e.span,{className:"token atrule",children:[(0,a.jsx)(e.span,{className:"token rule",children:"@import"})," path",(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]}),"\n\n",(0,a.jsxs)(e.span,{className:"token atrule",children:[(0,a.jsx)(e.span,{className:"token rule",children:"@value"})," ",(0,a.jsx)(e.span,{className:"token property",children:"bg"}),(0,a.jsx)(e.span,{className:"token punctuation",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./image.png"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]}),"\n\n",(0,a.jsx)(e.span,{className:"token selector",children:".a"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:"background"}),(0,a.jsx)(e.span,{className:"token punctuation",children:":"})," ",(0,a.jsxs)(e.span,{className:"token url",children:[(0,a.jsx)(e.span,{className:"token function",children:"url"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),"bg",(0,a.jsx)(e.span,{className:"token punctuation",children:")"})]}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"})]})}),"\n",(0,a.jsxs)(e.p,{children:["ê°ì ë°ì´í íí(",(0,a.jsx)(e.code,{children:'"./x"'}),", ",(0,a.jsx)(e.code,{children:"'./x'"}),")ë, ë°ì´í ìë íí(",(0,a.jsx)(e.code,{children:"./x"}),")ë 모ë ëìí©ëë¤. ì´ë¤ ííë¡ ìì±íë ê°ì¸ê³ ìë 문ìë ì ê±°ë ë¤ module requestë¡ í´ìëë¯ë¡, assetì ì¼ë°ì ì¸ webpack resolver ë° asset pipelineì ê±°ì¹ê³ ë¨ìí ìë³ìë¡ ë¨ì§ ììµëë¤."]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"multiple-aliases-via-exportsconvention"}),"Multiple Aliases via ",(0,a.jsx)(e.code,{children:"exportsConvention"}),(0,a.jsx)(e.a,{href:"#multiple-aliases-via-exportsconvention","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ì CSS Modulesì ",(0,a.jsx)(e.code,{children:"generator.exportsConvention"})," í¨ìíì ",(0,a.jsx)(e.code,{children:"string"}),"ë¿ ìëë¼ ",(0,a.jsx)(e.code,{children:"string[]"}),"ë ë°íí ì ììµëë¤. ë°°ì´ì ë°ííë©´ ë°°ì´ ìì 모ë ì´ë¦ì¼ë¡ í´ë¹ local classê° exportëë©°, ì´ë ",(0,a.jsx)(e.code,{children:"css-loader"}),"ì ëìê³¼ ëì¼í©ëë¤. ì를 ë¤ì´ ìë ì´ë¦ê³¼ ë문ì ë²ì ë ê°ì§ë¥¼ 모ë ë
¸ì¶íê³ ì¶ì ë ì ì©í©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:["module",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"experiments"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"css"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"module"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"generator"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token string-property property",children:'"css/module"'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token function-variable function",children:"exportsConvention"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token parameter",children:"name"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token operator",children:"=>"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),"name",(0,a.jsx)(e.span,{className:"token punctuation",children:","})," name",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"toUpperCase"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// JSìì ì¬ì©"}),"\n",(0,a.jsx)(e.span,{className:"token keyword",children:"import"})," styles ",(0,a.jsx)(e.span,{className:"token keyword",children:"from"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./button.module.css"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\nconsole",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"log"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),"styles",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"btn",(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})," ",(0,a.jsx)(e.span,{className:"token comment",children:"// í´ìë í´ëì¤"}),"\nconsole",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"log"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),"styles",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token constant",children:"BTN"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})," ",(0,a.jsx)(e.span,{className:"token comment",children:"// ê°ì í´ìë í´ëì¤, ë문ì ë³ì¹"})]})}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"linkinsert-hook"}),(0,a.jsx)(e.code,{children:"linkInsert"})," Hook",(0,a.jsx)(e.a,{href:"#linkinsert-hook","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["webpackì´ stylesheet ",(0,a.jsx)(e.code,{children:"<link>"}),"를 문ì ì´ëì ì½ì
í ì§ ì ì´íê³ ì¶ìë¤ë©´, ì´ì ì´ë¥¼ ìí hookì´ ìê²¼ìµëë¤. ",(0,a.jsx)(e.code,{children:"CssLoadingRuntimeModule.getCompilationHooks(compilation)"}),"ì ìë¡ì´ ",(0,a.jsx)(e.code,{children:"linkInsert"})," hookì ë
¸ì¶í©ëë¤. ì´ hookì 기본 ì½ì
ì½ë(",(0,a.jsx)(e.code,{children:"document.head.appendChild(link);"}),")ì ì²í¬ë¥¼ ì ë¬ë°ê³ , ë§í¬ë¥¼ ì°ê²°í ë ì¬ì©í JS를 ë°íí©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token keyword",children:"const"})," webpack ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token function",children:"require"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token string",children:'"webpack"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\n",(0,a.jsx)(e.span,{className:"token keyword",children:"class"})," ",(0,a.jsx)(e.span,{className:"token class-name",children:"MyLinkInsertPlugin"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token function",children:"apply"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token parameter",children:"compiler"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n compiler",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"hooks",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"thisCompilation",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"tap"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token string",children:'"MyLinkInsertPlugin"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token parameter",children:"compilation"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token operator",children:"=>"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token keyword",children:"const"})," hooks ",(0,a.jsx)(e.span,{className:"token operator",children:"="}),"\n webpack",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"web",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"CssLoadingRuntimeModule",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"getCompilationHooks"}),(0,a.jsx)(e.span,{clas
1sName:"token punctuation",children:"("}),"compilation",(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\n ",(0,a.jsx)(e.span,{className:"token comment",children:"// 기본 `document.head.appendChild(link);`를 ì¬ì ìí©ëë¤."}),"\n hooks",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"linkInsert",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"tap"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),"\n ",(0,a.jsx)(e.span,{className:"token string",children:'"MyLinkInsertPlugin"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsxs)(e.span,{className:"token parameter",children:["source",(0,a.jsx)(e.span,{className:"token punctuation",children:","})," chunk"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token operator",children:"=>"}),"\n ",(0,a.jsx)(e.span,{className:"token string",children:'\'link.setAttribute("data-injected", "true"); document.body.appendChild(link);\''}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n\nmodule",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"experiments"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"css"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"plugins"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),(0,a.jsx)(e.span,{className:"token keyword",children:"new"})," ",(0,a.jsx)(e.span,{className:"token class-name",children:"MyLinkInsertPlugin"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.p,{children:["ì´ hookì ",(0,a.jsx)(e.code,{children:"SyncWaterfallHook<[string, Chunk]>"}),"ì
ëë¤. ìë ëìì ì ì§íë ¤ë©´ 기본 ",(0,a.jsx)(e.code,{children:"source"}),"를 ë°ííê³ , ì½ì
ìì¹ë ë°©ìì ì¬ì ìíë ¤ë©´ ì¬ì©ì ì ì JS를 ë°ííë©´ ë©ëë¤."]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"ordermodules-hook"}),(0,a.jsx)(e.code,{children:"orderModules"})," Hook",(0,a.jsx)(e.a,{href:"#ordermodules-hook","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsx)(e.p,{children:'íëì chunkê° ì¬ë¬ íì¼ìì CSS를 ê°ì ¸ì¬ ë, webpackì 기본 ì ë ¬ì import graphì ëí ìì ì ë ¬(topological sort)ì
ëë¤. ëë¶ë¶ì ê²½ì°ìë ì ì íì§ë§, ì¤ì íë¡ì í¸ììë import graphê° ëª¨í¸í´ì "Conflicting order between CSS ..." ê²½ê³ ê° ë°ìíê³ , import 구조를 ì¬í¸íì§ ìë ì´ì ê¹ëí í´ê²°ì±
ì´ ìë ê²½ì°ê° ììµëë¤.'}),"\n",(0,a.jsxs)(e.p,{children:[(0,a.jsx)(e.code,{children:"CssModulesPlugin.getCompilationHooks(compilation)"}),"ì ìë¡ì´ ",(0,a.jsx)(e.code,{children:"orderModules"})," hookì plugin ìì±ììê² ê²°ì ì ì¸ ì°í ìë¨ì ì ê³µí©ëë¤. ì´ hookì ê° CSS source type(",(0,a.jsx)(e.code,{children:"CSS_IMPORT_TYPE"}),"ì ",(0,a.jsx)(e.code,{children:"CSS_TYPE"}),")ë§ë¤ í ë²ì© ì¤íëë©°, í´ë¹ chunkì module 목ë¡ì ì ì²´ module ì´ë¦ 기ì¤ì¼ë¡ 미리 ì ë ¬ë ìíë¡ ì ë¬ë©ëë¤. 기본 ëìì ì¬ì ìíë ¤ë©´ ì ë ¬ë ",(0,a.jsx)(e.code,{children:"Module[]"}),"ì ë°ííê³ , 기존 webpackì import-order ìì ì ë ¬ë¡ ê³ì ì§ííë ¤ë©´ ",(0,a.jsx)(e.code,{children:"undefined"}),"를 ë°ííë©´ ë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token keyword",children:"const"})," webpack ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token function",children:"require"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token string",children:'"webpack"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\n",(0,a.jsx)(e.span,{className:"token keyword",children:"class"})," ",(0,a.jsx)(e.span,{className:"token class-name",children:"CssOrderByPathPlugin"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token function",children:"apply"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token parameter",children:"compiler"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n compiler",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"hooks",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"thisCompilation",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"tap"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),"\n ",(0,a.jsx)(e.span,{className:"token string",children:'"CssOrderByPathPlugin"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token parameter",children:"compilation"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token operator",children:"=>"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token keyword",children:"const"})," hooks ",(0,a.jsx)(e.span,{className:"token operator",children:"="}),"\n webpack",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"css",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"CssModulesPlugin",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"getCompilationHooks"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),"compilation",(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\n ",(0,a.jsx)(e.span,{className:"token comment",children:"// Moduleì ì ì²´ module ì´ë¦ 기ì¤ì¼ë¡ 미리 ì ë ¬ëì´ ë¤ì´ìµëë¤."}),"\n ",(0,a.jsx)(e.span,{className:"token comment",children:"// ê·¸ëë¡ ë°ííë©´ íì¼ ê²½ë¡ ê¸°ì¤ì ê²°ì ì ìì를 ì¬ì©íê² ëì´"}),"\n ",(0,a.jsx)(e.span,{className:"token comment",children:"// conflicting order ê²½ê³ ë¥¼ í¼í ì ììµëë¤."}),"\n hooks",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"orderModules",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"tap"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),"\n ",(0,a.jsx)(e.span,{className:"token string",children:'"CssOrderByPathPlugin"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsxs)(e.span,{className:"token parameter",children:["_chunk",(0,a.jsx)(e.span,{className:"token punctuation",children:","})," modules"]}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token operator",children:"=>"})," modules",(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n\nmodule",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"experiments"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"css"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"plugins"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),(0,a.jsx)(e.span,{className:"token keyword",children:"new"})," ",(0,a.jsx)(e.span,{className:"token class-name",children:"CssOrderByPathPlugin"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.p,{children:["ì´ hookì ",(0,a.jsx)(e.code,{children:"SyncBailHook<[Chunk, Module[], Compilation], Module[] | undefined>"}),"ì
ëë¤. ",(0,a.jsx)(e.code,{children:"undefined"}),"ê° ìë ê°ì ì²ì ë°íí tapì ê²°ê³¼ê° ì¬ì©ë©ëë¤."]}),"\n",(0,a.jsxs)(e.h2,{children:[(0,a.jsx)(e.span,{id:"javascript-and-esm"}),"JavaScript and ESM",(0,a.jsx)(e.a,{href:"#javascript-and-esm","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"anonymous-default-export-naming"}),"Anonymous Default Export Naming",(0,a.jsx)(e.a,{href:"#anonymous-default-export-naming","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["Webpack 5.106ì ìµëª
default exportì ëí´ ES specì ë§ì¶° ",(0,a.jsx)(e.code,{children:".name"}),"ì ",(0,a.jsx)(e.code,{children:'"default"'}),"ë¡ ì¤ì íë ìì ì¬íì ëì
íìµëë¤. ëì ìì²´ë ì¬ë°ë¥´ì§ë§, ì´ ê³¼ì ìì ëë
íí ì ìë ",(0,a.jsx)(e.code,{children:"Object.defineProperty"})," í¸ì¶ì´ 주ì
ëì´ ë²ë¤ì´ 커ì§ë 문ì ê° ìììµëë¤. ",(0,a.jsx)(e.code,{children:'.name === "default"'}),"ì ê±°ì ìì¡´íì§ ìë library ìë¹ì ì
ì¥ììë ì´ ì¶ê° runtime helperê° ììí ì¤ë²í¤ëììµëë¤."]}),"\n",(0,a.jsxs)(e.p,{children:["5.107ììë ì´ ëìì ì ì´í ì ìëë¡ ìë¡ì´ ",(0,a.jsx)(e.code,{children:"module.parser.j
1avascript.anonymousDefaultExportName"})," ìµì
ì´ ì¶ê°ëììµëë¤. 기본ê°ì ì í리ì¼ì´ì
ììë ",(0,a.jsx)(e.code,{children:"true"}),", libraryììë(",(0,a.jsx)(e.code,{children:"output.library"}),"ê° ì¤ì ë ê²½ì°) ",(0,a.jsx)(e.code,{children:"false"}),"ì
ëë¤. ì í리ì¼ì´ì
ì 기본ì ì¼ë¡ spec í¸íì±ì ì ì§íê³ , library ìì±ìë ì´ë¥¼ 몰ë¼ë ì¶ê° runtime helper ë¹ì©ì ì¹ë¥´ì§ ìê² ë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// ì
ë ¥"}),"\n",(0,a.jsx)(e.span,{className:"token keyword",children:"export"})," ",(0,a.jsx)(e.span,{className:"token keyword",children:"default"})," ",(0,a.jsx)(e.span,{className:"token keyword",children:"function"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token comment",children:"/* ... */"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n\n",(0,a.jsx)(e.span,{className:"token comment",children:"// `anonymousDefaultExportName: true`를 ì¬ì©í ë(ì±ì 기본ê°)"}),"\n",(0,a.jsx)(e.span,{className:"token comment",children:'// runtimeì ë¤ì´í°ë¸ ESM ëìì ë§ì¶° .name = "default"를 ì¤ì í©ëë¤.'})]})}),"\n",(0,a.jsx)(e.p,{children:"기본ê°ì ëª
ìì ì¼ë¡ ë®ì´ì¸ ìë ììµëë¤."}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:["module",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"module"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"parser"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"javascript"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"anonymousDefaultExportName"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"false"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"preserving-defer-and-source-phase-on-externals"}),"Preserving ",(0,a.jsx)(e.code,{children:"defer"})," and ",(0,a.jsx)(e.code,{children:"source"})," Phase on Externals",(0,a.jsx)(e.a,{href:"#preserving-defer-and-source-phase-on-externals","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ì webpackì ESM ì¶ë ¥ìì import attributes를 ì ì§íë ê²ê³¼ ê°ì ë°©ìì¼ë¡, external dependencyì ëí ",(0,a.jsx)(e.code,{children:"defer"}),"ì ",(0,a.jsx)(e.code,{children:"source"})," import phase í¤ìëë ì ì§í©ëë¤. ì´ì ìë ì´ phase í¤ìëê° ì¶ë ¥ë¬¸ìì ì ê±°ëì기 ë문ì, externalì ëí ",(0,a.jsx)(e.code,{children:'import defer * as ns from "x"'}),"ë 결과물ìì deferred semantics를 ìììµëë¤."]}),"\n",(0,a.jsxs)(e.p,{children:["ì ì ",(0,a.jsx)(e.code,{children:"module"})," externalsì ê²½ì°, namespace defer importì ë¨ì¼ default source importë ì´ì ë²ë¤ ìë¨ì ë¤ì´í°ë¸ phase 구문ì¼ë¡ ê·¸ëë¡ ì¶ë ¥ë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// webpack.config.js"}),"\nmodule",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),"exports ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"output"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"module"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token boolean",children:"true"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"externalsType"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"module"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token literal-property property",children:"externals"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," ",(0,a.jsx)(e.span,{className:"token string-property property",children:'"external-mod"'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"external-mod"'})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"hljs language-text",children:'// ì
ë ¥\nimport defer * as ns from "external-mod";\nimport source v from "external-mod";\n\n// ì¶ë ¥ ê²°ê³¼\nimport defer * as ns from "external-mod";\nimport source v from "external-mod";'})}),"\n",(0,a.jsxs)(e.p,{children:["ëì ",(0,a.jsx)(e.code,{children:"import"})," externalsì ê²½ì°ìë ",(0,a.jsx)(e.code,{children:'import.defer("x")'}),"ì ",(0,a.jsx)(e.code,{children:'import.source("x")'}),"ê° ì§ì ì¶ë ¥ë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"hljs language-text",children:'// ì
ë ¥\nconst ns = await import.defer("external-mod");\nconst src = await import.source("external-mod");\n\n// ì¶ë ¥ ê²°ê³¼\nconst ns = await import.defer("external-mod");\nconst src = await import.source("external-mod");'})}),"\n",(0,a.jsxs)(e.p,{children:["ê´ë ¨ë ë íëì ê°ì ì¬íë ììµëë¤. ëì¼í externalì ìë¡ ë¤ë¥¸ ë phase(ëë attribute ì§í©)ë¡ importí´ë ë ì´ì íëì ",(0,a.jsx)(e.code,{children:"Exter
1nalModule"}),"ë¡ í©ì³ì§ì§ ììµëë¤. ê° ì¡°í©ì´ ë³ëì emitì ìì±íë¯ë¡, ì´ë í쪽 phaseê° ì¡°ì©í ëë½ëì§ ììµëë¤."]}),"\n",(0,a.jsxs)(e.h3,{children:[(0,a.jsx)(e.span,{id:"__no_side_effects__-annotation"}),(0,a.jsx)(e.code,{children:"#__NO_SIDE_EFFECTS__"})," Annotation",(0,a.jsx)(e.a,{href:"#__no_side_effects__-annotation","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ì webpackì ë ëì tree shakingì ìí´ í¨ì를 pureíë¤ê³ íìíë ",(0,a.jsx)(e.a,{href:"https://github.com/javascript-compiler-hints/compiler-notations-spec/blob/main/no-side-effects-notation-spec.md#2-const-variable-declaration",children:(0,a.jsx)(e.code,{children:"#__NO_SIDE_EFFECTS__"})})," annotationì ì§ìí©ëë¤. ì´ë ê² íìë í¨ìë í¨ì 본문ì ì ì ì¼ë¡ pureíë¤ê³ ë¶ìí ì ìëë¼ë, ë°íê°ì´ ì¬ì©ëì§ ìì¼ë©´ í¸ì¶ì´ ë²ë¤ìì ì ê±°ë ì ììµëë¤."]}),"\n","\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// utils.js"}),"\n",(0,a.jsx)(e.span,{className:"token comment",children:"/*#__NO_SIDE_EFFECTS__*/"}),"\n",(0,a.jsx)(e.span,{className:"token keyword",children:"export"})," ",(0,a.jsx)(e.span,{className:"token keyword",children:"function"})," ",(0,a.jsx)(e.span,{className:"token function",children:"createLogger"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token parameter",children:"prefix"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token keyword",children:"return"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token parameter",children:"msg"}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token operator",children:"=>"})," console",(0,a.jsx)(e.span,{className:"token punctuation",children:"."}),(0,a.jsx)(e.span,{className:"token function",children:"log"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsxs)(e.span,{className:"token template-string",children:[(0,a.jsx)(e.span,{className:"token template-punctuation string",children:"`"}),(0,a.jsx)(e.span,{className:"token string",children:"["}),(0,a.jsxs)(e.span,{className:"token interpolation",children:[(0,a.jsx)(e.span,{className:"token interpolation-punctuation punctuation",children:"${"}),"prefix",(0,a.jsx)(e.span,{className:"token interpolation-punctuation punctuation",children:"}"})]}),(0,a.jsx)(e.span,{className:"token string",children:"] "}),(0,a.jsxs)(e.span,{className:"token interpolation",children:[(0,a.jsx)(e.span,{className:"token interpolation-punctuation punctuation",children:"${"}),"msg",(0,a.jsx)(e.span,{className:"token interpolation-punctuation punctuation",children:"}"})]}),(0,a.jsx)(e.span,{className:"token template-punctuation string",children:"`"})]}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n\n",(0,a.jsx)(e.span,{className:"token keyword",children:"export"})," ",(0,a.jsx)(e.span,{className:"token keyword",children:"function"})," ",(0,a.jsx)(e.span,{className:"token function",children:"realWork"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token comment",children:"// ..."}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"})]})}),"\n","\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// app.js"}),"\n",(0,a.jsx)(e.span,{className:"token keyword",children:"import"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"})," createLogger",(0,a.jsx)(e.span,{className:"token punctuation",children:","})," realWork ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"})," ",(0,a.jsx)(e.span,{className:"token keyword",children:"from"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./utils"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\n",(0,a.jsx)(e.span,{className:"token comment",children:"// `createLogger`ì annotationì´ ìê³ ê²°ê³¼ê° ì¬ì©ëì§ ìì¼ë¯ë¡ ì ê±°ë©ëë¤."}),"\n",(0,a.jsx)(e.span,{className:"token keyword",children:"const"})," unused ",(0,a.jsx)(e.span,{className:"token operator",children:"="})," ",(0,a.jsx)(e.span,{className:"token function",children:"createLogger"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token string",children:'"debug"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n\n",(0,a.jsx)(e.span,{className:"token function",children:"realWork"}),(0,a.jsx)(e.span,{className:"token punctuation",children:"("}),(0,a.jsx)(e.span,{className:"token punctuation",children:")"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.aside,{className:"warning",children:[(0,a.jsx)(e.p,{className:"warning__prefix",children:"warning"}),(0,a.jsxs)(e.p,{children:["íì¬ ì´ annotationì ",(0,a.jsx)(e.strong,{children:"ì ì¸ë ëì¼ module ë´ë¶ììë§"})," í¨ê³¼ê° ììµëë¤. module ê° ì íë í¥í PRìì ì§ìë ìì ì
ëë¤."]})]}),"\n",(0,a.jsxs)(e.h2,{children:[(0,a.jsx)(e.span,{id:"resolver-updates"}),"Resolver Updates",(0,a.jsx)(e.a,{href:"#resolver-updates","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ì´ì webpackì resolver defaultsì 기본 ",(0,a.jsx)(e.code,{children:"conditionNames"}),"ì ",(0,a.jsx)(e.code,{children:'"module-sync"'}),"를 ì¶ê°íì¬ Node.jsì ëìì ë§ì¶¥ëë¤. Node.jsë ë기ì ì¼ë¡ ë¡ë ê°ë¥í ESMì ìí´ ",(0,a.jsx)(e.code,{children:"module-sync"})," community conditionì ì ê³µíë©°, ì´ë² ë³ê²½ì ESM, CJS, AMD, worker, wasm, build-dependency resolverì ìí¥ì ì¤ëë¤."]}),"\n",(0,a.jsxs)(e.p,{children:["구체ì ì¼ë¡ ë§íë©´, resolver defaultsì condition chainìë ì´ì ",(0,a.jsx)(e.code,{children:"module"})," ë°ë¡ ìì ",(0,a.jsx)(e.code,{children:"module-sync"}),"ê° í¬í¨ë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-js",children:[(0,a.jsx)(e.span,{className:"token comment",children:"// ì´ì (5.106)"}),"\n",(0,a.jsx)(e.span,{className:"token literal-property property",children:"conditionNames"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),(0,a.jsx)(e.span,{className:"token string",children:'"require"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"module"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"..."'}),(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})," ",(0,a.jsx)(e.span,{className:"token comment",children:"// CJS ìì¡´ì±"}),"\n",(0,a.jsx)(e.span,{className:"token literal-property property",children:"conditionNames"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),(0,a.jsx)(e.span,{className:"token string",children:'"import"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"module"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"..."'}),(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})," ",(0,a.jsx)(e.span,{className:"token comment",children:"// ESM ìì¡´ì±"}),"\n\n",(0,a.jsx)(e.span,{className:"token comment",children:"// ì´í (5.10
17)"}),"\n",(0,a.jsx)(e.span,{className:"token literal-property property",children:"conditionNames"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),(0,a.jsx)(e.span,{className:"token string",children:'"require"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"module-sync"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"module"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"..."'}),(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"}),"\n",(0,a.jsx)(e.span,{className:"token literal-property property",children:"conditionNames"}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"["}),(0,a.jsx)(e.span,{className:"token string",children:'"import"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"module-sync"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"module"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","})," ",(0,a.jsx)(e.span,{className:"token string",children:'"..."'}),(0,a.jsx)(e.span,{className:"token punctuation",children:"]"}),(0,a.jsx)(e.span,{className:"token punctuation",children:";"})]})}),"\n",(0,a.jsxs)(e.p,{children:["ì¦, ",(0,a.jsx)(e.code,{children:"package.json"}),"ì ",(0,a.jsx)(e.code,{children:"module-sync"})," export conditionì ê²ìíë í¨í¤ì§ë ì¶ê° ì¤ì ìì´ ìëì¼ë¡ ì íë©ëë¤."]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsxs)(e.code,{className:"hljs language-json",children:[(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:'"name"'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"my-package"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:'"exports"'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:'"."'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token punctuation",children:"{"}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:'"module-sync"'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./esm/index.js"'}),(0,a.jsx)(e.span,{className:"token punctuation",children:","}),"\n ",(0,a.jsx)(e.span,{className:"token property",children:'"default"'}),(0,a.jsx)(e.span,{className:"token operator",children:":"})," ",(0,a.jsx)(e.span,{className:"token string",children:'"./cjs/index.js"'}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n ",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"}),"\n",(0,a.jsx)(e.span,{className:"token punctuation",children:"}"})]})}),"\n",(0,a.jsxs)(e.h2,{children:[(0,a.jsx)(e.span,{id:"bug-fixes"}),"Bug Fixes",(0,a.jsx)(e.a,{href:"#bug-fixes","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["ë²ì ",(0,a.jsx)(e.a,{href:"https://github.com/webpack/webpack/releases/tag/v5.106.0",children:"5.
1106"})," ì´í ì¬ë¬ ë²ê·¸ê° ìì ëììµëë¤. ìì¸í ë´ì©ì ",(0,a.jsx)(e.a,{href:"https://github.com/webpack/webpack/blob/main/CHANGELOG.md",children:"changelog"}),"를 íì¸íì¸ì."]}),"\n",(0,a.jsxs)(e.h2,{children:[(0,a.jsx)(e.span,{id:"thanks"}),"Thanks",(0,a.jsx)(e.a,{href:"#thanks","aria-hidden":"true",tabIndex:"-1",children:(0,a.jsx)(e.span,{className:"header-link"})})]}),"\n",(0,a.jsxs)(e.p,{children:["Webpack 5.107ì ê°ë¥íê² í´ì£¼ì 모ë 기ì¬ìì ",(0,a.jsx)(e.a,{href:"https://github.com/webpack/webpack?tab=readme-ov-file#sponsoring",children:"ì¤í°ì"}),"ê» ì§ì¬ì¼ë¡ ê°ì¬ë립ëë¤.\nì½ë 기ì¬, 문ì ìì±, ì¬ì ì íì ë± ì´ë¤ ííì ì§ìì´ë Webpackì´ ëª¨ë를 ìí´ ê³ì ë°ì íê³ ê°ì ë ì ìëë¡ ëìì¤ëë¤."]})]})}function l(n={}){const{wrapper:e}={...(0,c.R)(),...n.components};return e?(0,a.jsx)(e,{...n,children:(0,a.jsx)(t,{...n})}):t(n)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.