[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EWDE2Q1GAG54PMASFYDP25":3,"skill-same:01M7EWDE2Q1GAG54PMASFYDP25":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7EWDE2Q1GAG54PMASFYDP25","ams-webpack-pro",null,"TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-webpack-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: webpack-pro\ndescription: Configure webpack for complex builds: loaders, plugins, code splitting, caching, Module Federation, and build performance. Use when maintaining or optimizing webpack setups.\ncategory: development\n---\n\n# Webpack Pro\n\nA practical guide to webpack for the teams that still run it (which is many): loaders and plugins, code splitting, long-term caching, Module Federation, and build-performance tuning — plus knowing when to migrate away.\n\n## Overview\n\nwebpack bundles everything through a graph of **loaders** (transform files: TS→JS, SCSS→CSS, images→URLs) and **plugins** (bundle-level work: HTML generation, env injection, minification). Its power is configurability; its cost is complexity and build speed. Modern practice: keep configs minimal, lean on defaults, and only reach for webpack-specific features (Module Federation, deep customization) when they earn their keep.\n\n## When to use\n\n- Maintaining existing webpack builds (Create React App ejections, legacy apps).\n- Module Federation for micro-frontends.\n- Highly custom build pipelines (custom loaders\u002Fplugins).\n- Build performance triage on slow webpack setups.\n- Deciding webpack vs Vite\u002Fesbuild for a new project (usually: choose the simpler tool unless you need webpack-only features).\n\n## Core concepts\n\n- **Entry\u002Foutput.** Entry points seed the module graph; output controls filenames, paths, and chunk naming. `[contenthash]` in filenames = long-term caching.\n- **Loaders.** `module.rules`: `test` (file pattern) → `use` (loader chain, applied right-to-left). `babel-loader`, `ts-loader`\u002F`swc-loader`, `css-loader`+`style-loader`\u002F`MiniCssExtractPlugin`, `asset modules` for files.\n- **Plugins.** `HtmlWebpackPlugin` (generate HTML), `DefinePlugin` (compile-time constants — mind string quoting), `MiniCssExtractPlugin` (CSS files in prod), `CopyPlugin` (static assets).\n- **Code splitting.** `optimization.splitChunks` (vendor\u002Fcommon chunks), dynamic `import()` (async chunks), `runtimeChunk: 'single'` (stable runtime for caching).\n- **Caching.** `[contenthash]`, `cache: { type: 'filesystem' }` (persistent build cache — the single biggest build-speed win), deterministic module\u002Fchunk IDs.\n- **Module Federation.** `ModuleFederationPlugin`: remotes expose modules, hosts consume them at runtime — micro-frontends with shared dependencies. Version alignment of shared deps (`react`, singleton) is the make-or-break detail.\n- **Dev server.** `webpack-dev-server` with HMR; `proxy` for API backends.\n\n## Practical workflow\n\n**1. Baseline config.**\n```js\n\u002F\u002F webpack.config.js\nmodule.exports = (env, argv) => {\n  const isProd = argv.mode === 'production';\n  return {\n    entry: '.\u002Fsrc\u002Findex.ts',\n    output: { path: path.resolve(__dirname, 'dist'), filename: isProd ? '[name].[contenthash].js' : '[name].js', clean: true },\n    cache: { type: 'filesystem' },\n    module: { rules: [\n      { test: \u002F\\.tsx?$\u002F, use: 'swc-loader', exclude: \u002Fnode_modules\u002F },\n      { test: \u002F\\.css$\u002F, use: [isProd ? MiniCssExtractPlugin.loader : 'style-loader', 'css-loader'] },\n      { test: \u002F\\.(png|svg)$\u002F, type: 'asset', parser: { dataUrlCondition: { maxSize: 8 * 1024 } } },\n    ]},\n    plugins: [ new HtmlWebpackPlugin({ template: '.\u002Fpublic\u002Findex.html' }), ...(isProd ? [new MiniCssExtractPlugin()] : []) ],\n    optimization: { splitChunks: { chunks: 'all' }, runtimeChunk: 'single' },\n    devtool: isProd ? 'source-map' : 'eval-cheap-module-source-map',\n    devServer: { hot: true, historyApiFallback: true, proxy: { '\u002Fapi': 'http:\u002F\u002Flocalhost:3000' } },\n  };\n};\n```\n\n**2. Speed triage.** Enable filesystem cache → replace `ts-loader`\u002F`babel-loader` with `swc-loader` → narrow `test`\u002F`include` so loaders skip `node_modules` → `webpack-bundle-analyzer` for bundle, `--progress` + `speed-measure-webpack-plugin` for build profile.\n\n**3. Federation (when needed).**\n```js\nnew ModuleFederationPlugin({\n  name: 'host', remotes: { shop: 'shop@https:\u002F\u002Fshop.cdn\u002FremoteEntry.js' },\n  shared: { react: { singleton: true, requiredVersion: '^18.0.0' } },\n});\n```\nSingleton + version alignment for shared libs; handle remote load failure with error boundaries\u002Ffallbacks.\n\n**4. Long-term caching check.** Build twice with a one-line change: only the changed chunk's hash should change. If vendor rehashes, something non-deterministic (or misordered modules) broke it.\n\n## Common pitfalls\n\n- **No persistent cache.** Rebuilding from scratch every time is the #1 avoidable slowness. `cache: { type: 'filesystem' }` first, questions later.\n- **babel-loader on everything.** Transpiling `node_modules` or using babel where swc suffices doubles build time. Scope loaders tightly.\n- **`DefinePlugin` quoting.** `new DefinePlugin({ API_URL: '\"https:\u002F\u002Fx\"' })` — values are code fragments; forget the inner quotes and you inject a bare identifier.\n- **Contenthash instability.** Plugins injecting timestamps\u002Frandomness rehash everything. Audit with double builds.\n- **Federation version skew.** Host on React 18, remote on React 17, non-singleton shared → two Reacts → hooks break mysteriously. Align and enforce singletons.\n- **Huge bundles unexamined.** No analyzer in the workflow = silent bloat. Run the analyzer on a schedule.\n- **Dev\u002Fprod config drift.** Two configs diverging until prod-only bugs appear. One config function with `isProd` branches beats two files.\n- **Source maps in prod.** `eval-*` devtool in production leaks source or breaks; use `source-map` (uploaded to error tracking, not served) or `hidden-source-map`.\n- **Staying on webpack out of inertia.** If the only reason is history and builds are painful, a Vite migration is often a few days' work — cost it honestly.\n","# Webpack Pro\n\nA practical guide to webpack for the teams that still run it (which is many): loaders and plugins, code splitting, long-term caching, Module Federation, and build-performance tuning — plus knowing when to migrate away.\n\n## Overview\n\nwebpack bundles everything through a graph of **loaders** (transform files: TS→JS, SCSS→CSS, images→URLs) and **plugins** (bundle-level work: HTML generation, env injection, minification). Its power is configurability; its cost is complexity and build speed. Modern practice: keep configs minimal, lean on defaults, and only reach for webpack-specific features (Module Federation, deep customization) when they earn their keep.\n\n## When to use\n\n- Maintaining existing webpack builds (Create React App ejections, legacy apps).\n- Module Federation for micro-frontends.\n- Highly custom build pipelines (custom loaders\u002Fplugins).\n- Build performance triage on slow webpack setups.\n- Deciding webpack vs Vite\u002Fesbuild for a new project (usually: choose the simpler tool unless you need webpack-only features).\n\n## Core concepts\n\n- **Entry\u002Foutput.** Entry points seed the module graph; output controls filenames, paths, and chunk naming. `[contenthash]` in filenames = long-term caching.\n- **Loaders.** `module.rules`: `test` (file pattern) → `use` (loader chain, applied right-to-left). `babel-loader`, `ts-loader`\u002F`swc-loader`, `css-loader`+`style-loader`\u002F`MiniCssExtractPlugin`, `asset modules` for files.\n- **Plugins.** `HtmlWebpackPlugin` (generate HTML), `DefinePlugin` (compile-time constants — mind string quoting), `MiniCssExtractPlugin` (CSS files in prod), `CopyPlugin` (static assets).\n- **Code splitting.** `optimization.splitChunks` (vendor\u002Fcommon chunks), dynamic `import()` (async chunks), `runtimeChunk: 'single'` (stable runtime for caching).\n- **Caching.** `[contenthash]`, `cache: { type: 'filesystem' }` (persistent build cache — the single biggest build-speed win), deterministic module\u002Fchunk IDs.\n- **Module Federation.** `ModuleFederationPlugin`: remotes expose modules, hosts consume them at runtime — micro-frontends with shared dependencies. Version alignment of shared deps (`react`, singleton) is the make-or-break detail.\n- **Dev server.** `webpack-dev-server` with HMR; `proxy` for API backends.\n\n## Practical workflow\n\n**1. Baseline config.**\n```js\n\u002F\u002F webpack.config.js\nmodule.exports = (env, argv) => {\n  const isProd = argv.mode === 'production';\n  return {\n    entry: '.\u002Fsrc\u002Findex.ts',\n    output: { path: path.resolve(__dirname, 'dist'), filename: isProd ? '[name].[contenthash].js' : '[name].js', clean: true },\n    cache: { type: 'filesystem' },\n    module: { rules: [\n      { test: \u002F\\.tsx?$\u002F, use: 'swc-loader', exclude: \u002Fnode_modules\u002F },\n      { test: \u002F\\.css$\u002F, use: [isProd ? MiniCssExtractPlugin.loader : 'style-loader', 'css-loader'] },\n      { test: \u002F\\.(png|svg)$\u002F, type: 'asset', parser: { dataUrlCondition: { maxSize: 8 * 1024 } } },\n    ]},\n    plugins: [ new HtmlWebpackPlugin({ template: '.\u002Fpublic\u002Findex.html' }), ...(isProd ? [new MiniCssExtractPlugin()] : []) ],\n    optimization: { splitChunks: { chunks: 'all' }, runtimeChunk: 'single' },\n    devtool: isProd ? 'source-map' : 'eval-cheap-module-source-map',\n    devServer: { hot: true, historyApiFallback: true, proxy: { '\u002Fapi': 'http:\u002F\u002Flocalhost:3000' } },\n  };\n};\n```\n\n**2. Speed triage.** Enable filesystem cache → replace `ts-loader`\u002F`babel-loader` with `swc-loader` → narrow `test`\u002F`include` so loaders skip `node_modules` → `webpack-bundle-analyzer` for bundle, `--progress` + `speed-measure-webpack-plugin` for build profile.\n\n**3. Federation (when needed).**\n```js\nnew ModuleFederationPlugin({\n  name: 'host', remotes: { shop: 'shop@https:\u002F\u002Fshop.cdn\u002FremoteEntry.js' },\n  shared: { react: { singleton: true, requiredVersion: '^18.0.0' } },\n});\n```\nSingleton + version alignment for shared libs; handle remote load failure with error boundaries\u002Ffallbacks.\n\n**4. Long-term caching check.** Build twice with a one-line change: only the changed chunk's hash should change. If vendor rehashes, something non-deterministic (or misordered modules) broke it.\n\n## Common pitfalls\n\n- **No persistent cache.** Rebuilding from scratch every time is the #1 avoidable slowness. `cache: { type: 'filesystem' }` first, questions later.\n- **babel-loader on everything.** Transpiling `node_modules` or using babel where swc suffices doubles build time. Scope loaders tightly.\n- **`DefinePlugin` quoting.** `new DefinePlugin({ API_URL: '\"https:\u002F\u002Fx\"' })` — values are code fragments; forget the inner quotes and you inject a bare identifier.\n- **Contenthash instability.** Plugins injecting timestamps\u002Frandomness rehash everything. Audit with double builds.\n- **Federation version skew.** Host on React 18, remote on React 17, non-singleton shared → two Reacts → hooks break mysteriously. Align and enforce singletons.\n- **Huge bundles unexamined.** No analyzer in the workflow = silent bloat. Run the analyzer on a schedule.\n- **Dev\u002Fprod config drift.** Two configs diverging until prod-only bugs appear. One config function with `isProd` branches beats two files.\n- **Source maps in prod.** `eval-*` devtool in production leaks source or breaks; use `source-map` (uploaded to error tracking, not served) or `hidden-source-map`.\n- **Staying on webpack out of inertia.** If the only reason is history and builds are painful, a Vite migration is often a few days' work — cost it honestly.\n",{},"main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-webpack-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill ams-webpack-pro",{"tool":37,"command":38},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill ams-webpack-pro",{"tool":40,"command":41},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill ams-webpack-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-webpack-pro\u002FSKILL.md",true,[],[46,53,61,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":57,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]