├── src ├── CNAME ├── assets │ ├── robots.txt │ ├── ag-grid-logo.png │ ├── ag-charts-logo.png │ ├── ag-grid-logo-dark.png │ ├── geomanist-medium.woff │ ├── icon-pwa-512x512.png │ ├── ag-charts-logo-dark.png │ ├── geomanist-medium.woff2 │ ├── icon-square-small-slack.png │ ├── supporters-noneedtostudy-logo-medium.png │ ├── icon-square-small.svg │ ├── icon-square-big.svg │ ├── by.svg │ ├── cc.svg │ ├── github-logo.svg │ ├── icon-print.svg │ ├── link.svg │ ├── site-logo.svg │ ├── logo-on-dark-bg.svg │ └── logo-on-white-bg.svg ├── favicon.ico ├── components │ ├── Splash │ │ ├── first │ │ │ ├── left.mdx │ │ │ └── right.mdx │ │ ├── second │ │ │ ├── right.mdx │ │ │ └── left.mdx │ │ └── Splash.scss │ ├── Support │ │ ├── logos │ │ │ └── segment.png │ │ ├── AdditionalSupporters.js │ │ └── Support.scss │ ├── Badge │ │ ├── Badge.scss │ │ └── Badge.js │ ├── Container │ │ ├── Container.scss │ │ └── Container.jsx │ ├── Logo │ │ ├── Logo.scss │ │ └── Logo.jsx │ ├── Print │ │ ├── Print.scss │ │ ├── PrintScript.js │ │ └── Print.js │ ├── PageNotFound │ │ ├── PageNotFound.scss │ │ └── PageNotFound.jsx │ ├── NotificationBar │ │ ├── Notification.mdx │ │ ├── NotificationBar.jsx │ │ └── MessageBar.jsx │ ├── BrandingSample.jsx │ ├── Markdown │ │ ├── Markdown.jsx │ │ └── prism-theme.scss │ ├── Page │ │ ├── Page.scss │ │ ├── AdjacentPages.scss │ │ └── AdjacentPages.jsx │ ├── Contributors │ │ ├── 404.js │ │ └── Contributors.jsx │ ├── Shield │ │ └── Shield.jsx │ ├── Configuration │ │ └── Configuration.scss │ ├── mdxComponents │ │ └── Link.js │ ├── Site │ │ ├── clientSideRedirections.js │ │ └── Site.scss │ ├── Link │ │ └── Link.jsx │ ├── StackBlitzPreview │ │ └── StackBlitzPreview.jsx │ ├── Cube │ │ └── Cube.scss │ ├── TextRotater │ │ └── TextRotater.scss │ ├── Placeholder │ │ ├── Placeholder.scss │ │ └── Placeholder.js │ ├── Sidebar │ │ └── Sidebar.scss │ ├── SplashViz │ │ ├── SplashViz.jsx │ │ └── SplashViz.scss │ ├── Dropdown │ │ └── Dropdown.scss │ ├── PageLinks │ │ └── PageLinks.jsx │ ├── CodeBlockWithCopy │ │ ├── CodeBlockWithCopy.scss │ │ └── CodeBlockWithCopy.jsx │ ├── Footer │ │ ├── Footer.scss │ │ └── Footer.jsx │ ├── Sponsors │ │ └── Sponsors.jsx │ └── SidebarItem │ │ └── SidebarItem.scss ├── utilities │ ├── is-client.js │ ├── list2Tree │ │ ├── findTopLevel.test.js │ │ ├── findTopLevel.js │ │ ├── index.js │ │ └── index.test.js │ ├── flatten-content-tree.mjs │ ├── find-files-in-dist.js │ ├── get-adjacent-pages │ │ ├── index.mjs │ │ └── index.test.mjs │ ├── test-local-storage.js │ ├── yaml-headmatter.mjs │ ├── __snapshots__ │ │ └── process-readme.test.mjs.snap │ ├── githubAPI.mjs │ ├── constants.mjs │ └── content-utils.test.mjs ├── index.html ├── constants │ └── theme.js ├── App.jsx ├── styles │ ├── icons │ │ ├── gitter.svg │ │ ├── vertical-bar.svg │ │ ├── x.svg │ │ ├── chevron-down.svg │ │ ├── chevron-up.svg │ │ ├── chevron-left.svg │ │ ├── chevron-right.svg │ │ ├── edit.svg │ │ ├── cross.svg │ │ ├── stack-overflow.svg │ │ ├── menu.svg │ │ ├── medium.svg │ │ ├── magnifying-glass.svg │ │ ├── exit-right.svg │ │ ├── hamburger.svg │ │ ├── github.svg │ │ └── loading.svg │ ├── partials │ │ ├── _functions.scss │ │ ├── _mixins.scss │ │ └── _vars.scss │ ├── tailwind.css │ ├── index.scss │ └── reset.css ├── content │ ├── migrate │ │ └── index.mdx │ ├── blog │ │ └── index.mdx │ ├── plugins │ │ ├── NoEmitOnErrorsPlugin.mdx │ │ ├── min-chunk-size-plugin.mdx │ │ ├── prefetch-plugin.mdx │ │ ├── context-exclusion-plugin.mdx │ │ ├── watch-ignore-plugin.mdx │ │ ├── automatic-prefetch-plugin.mdx │ │ ├── hot-module-replacement-plugin.mdx │ │ ├── profiling-plugin.mdx │ │ ├── hashed-module-ids-plugin.mdx │ │ ├── limit-chunk-count-plugin.mdx │ │ ├── html-webpack-plugin.mdx │ │ ├── banner-plugin.mdx │ │ └── provide-plugin.mdx │ ├── license.mdx │ ├── contribute │ │ └── release-process.mdx │ ├── guides │ │ ├── index.mdx │ │ ├── environment-variables.mdx │ │ └── entry-advanced.mdx │ ├── index.mdx │ ├── concepts │ │ ├── dependency-graph.mdx │ │ └── output.mdx │ ├── api │ │ ├── contextmodulefactory-hooks.mdx │ │ ├── index.mdx │ │ └── resolvers.mdx │ └── configuration │ │ └── plugins.mdx ├── remark-plugins │ ├── remark-remove-heading-id │ │ ├── __snapshots__ │ │ │ └── index.test.mjs.snap │ │ ├── index.mjs │ │ └── index.test.mjs │ ├── remark-slug │ │ ├── __snapshots__ │ │ │ └── index.test.mjs.snap │ │ ├── index.test.mjs │ │ ├── license │ │ └── index.mjs │ ├── remark-custom-asides │ │ ├── __snapshots__ │ │ │ └── index.test.mjs.snap │ │ ├── index.test.mjs │ │ └── index.mjs │ ├── remark-cleanup-readme │ │ ├── index.mjs │ │ └── __snapshots__ │ │ │ └── index.test.mjs.snap │ └── remark-responsive-table │ │ ├── __snapshots__ │ │ └── remark-responsive-table.test.mjs.snap │ │ ├── remark-responsive-table.test.mjs │ │ └── remark-responsive-table.mjs ├── mdx-components.js ├── index.jsx ├── scripts │ └── build-content-tree.mjs ├── server.jsx └── ProdAssetsManifest.mjs ├── .husky └── pre-commit ├── .npmrc ├── .prettierignore ├── .browserslistrc ├── examples ├── module-federation │ ├── app2 │ │ ├── src │ │ │ ├── index.js │ │ │ ├── bootstrap.js │ │ │ └── App.js │ │ ├── public │ │ │ └── index.html │ │ ├── package.json │ │ └── webpack.config.js │ ├── lerna.json │ ├── app1 │ │ ├── src │ │ │ ├── bootstrap.js │ │ │ ├── index.js │ │ │ └── App.js │ │ ├── public │ │ │ └── index.html │ │ ├── package.json │ │ └── webpack.config.js │ ├── package.json │ └── README.md └── getting-started │ ├── README.md │ ├── webpack.config.js │ ├── dist │ └── index.html │ ├── src │ └── index.js │ └── package.json ├── .markdownlintignore ├── browserstack-logo.png ├── postcss.config.js ├── prettier.config.js ├── .vale └── proselint │ ├── Very.yml │ ├── Hyperbole.yml │ ├── Currency.yml │ ├── DateMidnight.yml │ ├── But.yml │ ├── Annotations.yml │ ├── DateSpacing.yml │ ├── P-Value.yml │ ├── Apologizing.yml │ ├── DateCase.yml │ ├── Hedging.yml │ ├── Airlinese.yml │ ├── Malapropisms.yml │ ├── Jargon.yml │ ├── Typography.yml │ ├── Cursing.yml │ ├── Skunked.yml │ ├── LGBTOffensive.yml │ ├── DateRedundancy.yml │ ├── Spelling.yml │ ├── Oxymorons.yml │ ├── RASSyndrome.yml │ ├── meta.json │ ├── LGBTTerms.yml │ ├── CorporateSpeak.yml │ ├── Archaisms.yml │ ├── Uncomparables.yml │ ├── Nonwords.yml │ ├── AnimalLabels.yml │ ├── README.md │ ├── GenderBias.yml │ ├── GroupTerms.yml │ └── Diacritical.yml ├── .gitignore ├── cypress ├── e2e │ ├── search.cy.js │ ├── toggle-dark-mode.cy.js │ ├── check-sub-navigation.cy.js │ ├── client-side-redirection.cy.js │ ├── click-menu-scroll-top.cy.js │ ├── scroll.cy.js │ ├── check-server-side-rendering.cy.js │ └── pr_4435.cy.js ├── support │ ├── commands.js │ └── e2e.js └── plugins │ └── index.js ├── repositories └── README.md ├── .vale.ini ├── jest.config.mjs ├── .babelrc ├── .editorconfig ├── sitemap-ignore.json ├── cypress.config.js ├── .markdownlint.json ├── .github ├── workflows │ ├── dependency-review.yml │ └── deploy.yml ├── dependabot.yml ├── ISSUE_TEMPLATE │ └── Documentation_request.md └── actions │ └── webpack-persistent-cache │ └── action.yml ├── tailwind.config.js ├── webpack.dev.mjs ├── webpack.prod.mjs └── .eslintrc.js /src/CNAME: -------------------------------------------------------------------------------- 1 | webpack.js.org 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | lint-staged 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist 2 | examples 3 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | not ie 11 3 | -------------------------------------------------------------------------------- /src/assets/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /**/printable/ -------------------------------------------------------------------------------- /examples/module-federation/app2/src/index.js: -------------------------------------------------------------------------------- 1 | import("./bootstrap"); -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/favicon.ico -------------------------------------------------------------------------------- /.markdownlintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src/content/loaders/_*.mdx 3 | src/content/plugins/_*.mdx 4 | -------------------------------------------------------------------------------- /browserstack-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/browserstack-logo.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [require('tailwindcss'), require('autoprefixer')], 3 | }; 4 | -------------------------------------------------------------------------------- /src/assets/ag-grid-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/ag-grid-logo.png -------------------------------------------------------------------------------- /src/assets/ag-charts-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/ag-charts-logo.png -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | semi: true, 4 | trailingComma: 'es5', 5 | }; 6 | -------------------------------------------------------------------------------- /src/assets/ag-grid-logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/ag-grid-logo-dark.png -------------------------------------------------------------------------------- /src/assets/geomanist-medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/geomanist-medium.woff -------------------------------------------------------------------------------- /src/assets/icon-pwa-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/icon-pwa-512x512.png -------------------------------------------------------------------------------- /src/assets/ag-charts-logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/ag-charts-logo-dark.png -------------------------------------------------------------------------------- /src/assets/geomanist-medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/geomanist-medium.woff2 -------------------------------------------------------------------------------- /src/components/Splash/first/left.mdx: -------------------------------------------------------------------------------- 1 | **src/index.js** 2 | 3 | ```js 4 | import bar from './bar.js'; 5 | 6 | bar(); 7 | ``` 8 | -------------------------------------------------------------------------------- /examples/module-federation/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "npmClient": "yarn", 4 | "useWorkspaces": true 5 | } 6 | -------------------------------------------------------------------------------- /src/components/Splash/first/right.mdx: -------------------------------------------------------------------------------- 1 | **src/bar.js** 2 | 3 | ```js 4 | export default function bar() { 5 | // 6 | } 7 | ``` 8 | -------------------------------------------------------------------------------- /.vale/proselint/Very.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Remove '%s'." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - very 7 | -------------------------------------------------------------------------------- /src/assets/icon-square-small-slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/icon-square-small-slack.png -------------------------------------------------------------------------------- /src/components/Support/logos/segment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/components/Support/logos/segment.png -------------------------------------------------------------------------------- /src/utilities/is-client.js: -------------------------------------------------------------------------------- 1 | const isClient = window !== undefined && window.document !== undefined; 2 | 3 | module.exports = isClient; 4 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | -------------------------------------------------------------------------------- /src/constants/theme.js: -------------------------------------------------------------------------------- 1 | export const THEME = { 2 | DARK: 'dark', 3 | LIGHT: 'light', 4 | }; 5 | 6 | export const THEME_LOCAL_STORAGE_KEY = 'theme'; 7 | -------------------------------------------------------------------------------- /.vale/proselint/Hyperbole.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is hyperbolic." 3 | level: error 4 | nonword: true 5 | tokens: 6 | - '[a-z]+[!?]{2,}' 7 | -------------------------------------------------------------------------------- /src/assets/supporters-noneedtostudy-logo-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webpack/webpack.js.org/main/src/assets/supporters-noneedtostudy-logo-medium.png -------------------------------------------------------------------------------- /src/App.jsx: -------------------------------------------------------------------------------- 1 | import Site from './components/Site/Site'; 2 | export default function App() { 3 | return import(`./content/${path}`)} />; 4 | } 5 | -------------------------------------------------------------------------------- /.vale/proselint/Currency.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Incorrect use of symbols in '%s'." 3 | ignorecase: true 4 | raw: 5 | - \$[\d]* ?(?:dollars|usd|us dollars) 6 | -------------------------------------------------------------------------------- /.vale/proselint/DateMidnight.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Use 'midnight' or 'noon'." 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '12 ?[ap]\.?m\.?' 8 | -------------------------------------------------------------------------------- /src/components/Badge/Badge.scss: -------------------------------------------------------------------------------- 1 | .badge { 2 | background-color: #1d78c1; 3 | padding: 0 4px; 4 | color: #fff; 5 | position: relative; 6 | top: -4px; 7 | font-size: 14px; 8 | } 9 | -------------------------------------------------------------------------------- /src/components/Container/Container.scss: -------------------------------------------------------------------------------- 1 | @import 'vars'; 2 | @import 'mixins'; 3 | 4 | .container { 5 | width: 100%; 6 | max-width: map-get($screens, large); 7 | margin: 0 auto; 8 | } 9 | -------------------------------------------------------------------------------- /.vale/proselint/But.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Do not start a paragraph with a 'but'." 3 | level: error 4 | scope: paragraph 5 | action: 6 | name: remove 7 | tokens: 8 | - ^But 9 | -------------------------------------------------------------------------------- /src/styles/icons/gitter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vale/proselint/Annotations.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' left in text." 3 | ignorecase: false 4 | level: error 5 | tokens: 6 | - XXX 7 | - FIXME 8 | - TODO 9 | - NOTE 10 | -------------------------------------------------------------------------------- /.vale/proselint/DateSpacing.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "It's standard to put a space before '%s'" 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '\d{1,2}[ap]\.?m\.?' 8 | -------------------------------------------------------------------------------- /.vale/proselint/P-Value.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "You should use more decimal places, unless '%s' is really true." 3 | ignorecase: true 4 | level: suggestion 5 | tokens: 6 | - 'p = 0\.0{2,4}' 7 | -------------------------------------------------------------------------------- /.vale/proselint/Apologizing.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Excessive apologizing: '%s'" 3 | ignorecase: true 4 | level: error 5 | action: 6 | name: remove 7 | tokens: 8 | - More research is needed 9 | -------------------------------------------------------------------------------- /.vale/proselint/DateCase.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: With lowercase letters, the periods are standard. 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '\d{1,2} ?[ap]m\b' 8 | -------------------------------------------------------------------------------- /.vale/proselint/Hedging.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is hedging." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - I would argue that 7 | - ', so to speak' 8 | - to a certain degree 9 | -------------------------------------------------------------------------------- /examples/module-federation/app1/src/bootstrap.js: -------------------------------------------------------------------------------- 1 | import App from "./App"; 2 | import React from "react"; 3 | import ReactDOM from "react-dom"; 4 | 5 | ReactDOM.render(, document.getElementById("root")); 6 | -------------------------------------------------------------------------------- /examples/module-federation/app2/src/bootstrap.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | 4 | import App from "./App"; 5 | 6 | ReactDOM.render(, document.getElementById("root")); 7 | -------------------------------------------------------------------------------- /src/components/Logo/Logo.scss: -------------------------------------------------------------------------------- 1 | .logo { 2 | float: left; 3 | width: auto; 4 | height: 35px; 5 | opacity: 0.9; 6 | transition: opacity 250ms; 7 | 8 | &:hover { 9 | opacity: 1; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/content/migrate/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Migrate 3 | sort: -1 4 | contributors: 5 | - EugeneHlushko 6 | --- 7 | 8 | This section contains information about migrating from older versions of webpack to newer ones. 9 | -------------------------------------------------------------------------------- /src/styles/icons/vertical-bar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/icons/x.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/getting-started/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ## How to use 4 | 5 | Run the following commands in the root directory. 6 | 7 | ```bash 8 | npm install 9 | npm run build 10 | npm run start 11 | ``` 12 | -------------------------------------------------------------------------------- /src/components/Print/Print.scss: -------------------------------------------------------------------------------- 1 | .sidebar-link__print { 2 | display: flex; 3 | vertical-align: center; 4 | flex-wrap: nowrap; 5 | 6 | img { 7 | height: 20px; 8 | margin-right: 2px; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.vale/proselint/Airlinese.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is airlinese." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - enplan(?:e|ed|ing|ement) 7 | - deplan(?:e|ed|ing|ement) 8 | - taking off momentarily 9 | -------------------------------------------------------------------------------- /.vale/proselint/Malapropisms.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is a malapropism." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - the infinitesimal universe 7 | - a serial experience 8 | - attack my voracity 9 | -------------------------------------------------------------------------------- /src/styles/icons/chevron-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/icons/chevron-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/icons/chevron-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/icons/chevron-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/getting-started/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: './src/index.js', 5 | output: { 6 | filename: 'main.js', 7 | path: path.resolve(__dirname, 'dist'), 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /src/styles/icons/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/getting-started/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Getting Started 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/components/PageNotFound/PageNotFound.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | text-decoration: none; 3 | display: inline-block; 4 | padding: 3px 5px; 5 | font-size: 1.1rem; 6 | border-radius: 5px; 7 | width: auto; 8 | border: 1px solid #1a6bac; 9 | } 10 | -------------------------------------------------------------------------------- /src/styles/icons/cross.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/icons/stack-overflow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/module-federation/app1/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | App 1 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/module-federation/app2/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | App 2 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /src/components/Badge/Badge.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import './Badge.scss'; 3 | Badge.propTypes = { 4 | text: PropTypes.string.isRequired, 5 | }; 6 | export default function Badge(props) { 7 | return {props.text}; 8 | } 9 | -------------------------------------------------------------------------------- /src/components/NotificationBar/Notification.mdx: -------------------------------------------------------------------------------- 1 | You are reading the documentation for webpack 5, the latest release. Read the webpack 4 documentation here. See the migration guide for upgrading to webpack 5. 2 | -------------------------------------------------------------------------------- /.vale/proselint/Jargon.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is jargon." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - in the affirmative 7 | - in the negative 8 | - agendize 9 | - per your order 10 | - per your request 11 | - disincentivize 12 | -------------------------------------------------------------------------------- /examples/module-federation/app1/src/index.js: -------------------------------------------------------------------------------- 1 | // You can write your own logic here to determine the actual url 2 | window.app2Url = "http://localhost:3002" 3 | 4 | // Use dynamic import here to allow webpack to interface with module federation code 5 | import("./bootstrap"); 6 | -------------------------------------------------------------------------------- /src/components/BrandingSample.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | BrandingSample.propTypes = { 3 | color: PropTypes.string.isRequired, 4 | }; 5 | export default function BrandingSample({ color }) { 6 | return
 
; 7 | } 8 | -------------------------------------------------------------------------------- /src/components/Markdown/Markdown.jsx: -------------------------------------------------------------------------------- 1 | import './Markdown.scss'; 2 | import PropTypes from 'prop-types'; 3 | 4 | const Markdown = (props) =>
{props.children}
; 5 | Markdown.propTypes = { 6 | children: PropTypes.node, 7 | }; 8 | export default Markdown; 9 | -------------------------------------------------------------------------------- /src/components/Page/Page.scss: -------------------------------------------------------------------------------- 1 | @import 'mixins'; 2 | @import 'functions'; 3 | 4 | .page { 5 | flex: 1 1 auto; 6 | position: relative; 7 | overflow-x: hidden; 8 | padding: 1.5em 1em; 9 | 10 | @include break { 11 | flex: 3; 12 | padding: 1.5em; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/remark-plugins/remark-remove-heading-id/__snapshots__/index.test.mjs.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`customize blockquote should add id 1`] = ` 4 | "

hello world

5 |

this is me.

6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | !examples/**/dist 4 | src/**/_*.json 5 | src/**/_*.mdx 6 | .vscode 7 | .idea 8 | .DS_Store 9 | npm-debug.log 10 | yarn-error.log 11 | package-lock.json 12 | .cache 13 | internal-links.tap 14 | stats.json 15 | printable.mdx 16 | repositories/*.json 17 | -------------------------------------------------------------------------------- /.vale/proselint/Typography.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: Consider using the '%s' symbol instead of '%s'. 3 | level: error 4 | nonword: true 5 | swap: 6 | '\.\.\.': … 7 | '\([cC]\)': © 8 | '\(TM\)': ™ 9 | '\(tm\)': ™ 10 | '\([rR]\)': ® 11 | '[0-9]+ ?x ?[0-9]+': × 12 | -------------------------------------------------------------------------------- /cypress/e2e/search.cy.js: -------------------------------------------------------------------------------- 1 | describe('Search', () => { 2 | it('should visit entry page', () => { 3 | cy.visit('/concepts/'); 4 | cy.get('.DocSearch').click(); 5 | cy.get('#docsearch-input').type('roadmap'); 6 | cy.get('.DocSearch-Hits').should('be.visible'); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /src/components/Contributors/404.js: -------------------------------------------------------------------------------- 1 | // contributors 404 2 | export const contributorsNotFound = [ 3 | 'bartushek', 4 | 'rynclark', 5 | 'henriquea', 6 | 'makuzaverite', 7 | 'MijaelWatts', 8 | 'Kolhar730', 9 | 'grrizzly', 10 | 'maxloh', 11 | 'varunjayaraman', 12 | ]; 13 | -------------------------------------------------------------------------------- /src/components/Splash/second/right.mdx: -------------------------------------------------------------------------------- 1 | **page.html** 2 | 3 | ```html 4 | 5 | 6 | 7 | 8 | ... 9 | 10 | 11 | ... 12 | 13 | 14 | 15 | ``` 16 | -------------------------------------------------------------------------------- /src/remark-plugins/remark-slug/__snapshots__/index.test.mjs.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`remark slug should add id 1`] = ` 4 | "

hello world

5 |

this is me.

6 | " 7 | `; 8 | -------------------------------------------------------------------------------- /src/styles/icons/menu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vale/proselint/Cursing.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "Consider replacing '%s'." 3 | level: error 4 | ignorecase: true 5 | tokens: 6 | - shit 7 | - piss 8 | - fuck 9 | - cunt 10 | - cocksucker 11 | - motherfucker 12 | - tits 13 | - fart 14 | - turd 15 | - twat 16 | -------------------------------------------------------------------------------- /src/styles/icons/medium.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /repositories/README.md: -------------------------------------------------------------------------------- 1 | # webpack documentation repositories 2 | 3 | The files in this directory are auto generated from [`fetch-package-repos.mjs`](../src/utilities/fetch-package-repos.mjs) and should not be edited by hand. Any manual changes will be overwritten by the automation next time it runs. 4 | -------------------------------------------------------------------------------- /src/content/blog/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Blog 3 | sort: -1 4 | contributors: 5 | - sokra 6 | --- 7 | 8 | Read here for announcements. 9 | 10 | See recent blog posts in the side bar. 11 | 12 | ## Popular posts 13 | 14 | - [Webpack 5 release (2020-10-10)](/blog/2020-10-10-webpack-5-release/) 15 | -------------------------------------------------------------------------------- /src/remark-plugins/remark-custom-asides/__snapshots__/index.test.mjs.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`customize blockquote should transform W> into aside of warning 1`] = ` 4 | " 5 | " 6 | `; 7 | -------------------------------------------------------------------------------- /.vale.ini: -------------------------------------------------------------------------------- 1 | # Vale configuration file. 2 | # 3 | # For more information, see https://vale.sh/docs/topics/config/ 4 | 5 | 6 | StylesPath = .vale 7 | MinAlertLevel = warning 8 | 9 | [*.{md,mdx}] 10 | BasedOnStyles = proselint 11 | 12 | proselint.But = NO 13 | proselint.Typography = NO 14 | proselint.Annotations = NO -------------------------------------------------------------------------------- /.vale/proselint/Skunked.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is a bit of a skunked term — impossible to use without issue." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - bona fides 7 | - deceptively 8 | - decimate 9 | - effete 10 | - fulsome 11 | - hopefully 12 | - impassionate 13 | - Thankfully 14 | -------------------------------------------------------------------------------- /src/components/Logo/Logo.jsx: -------------------------------------------------------------------------------- 1 | import Logo from '../../assets/site-logo.svg'; 2 | import './Logo.scss'; 3 | 4 | export default function LogoComp() { 5 | return ( 6 | webpack logo 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /.vale/proselint/LGBTOffensive.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is offensive. Remove it or consider the context." 3 | ignorecase: true 4 | tokens: 5 | - fag 6 | - faggot 7 | - dyke 8 | - sodomite 9 | - homosexual agenda 10 | - gay agenda 11 | - transvestite 12 | - homosexual lifestyle 13 | - gay lifestyle 14 | -------------------------------------------------------------------------------- /src/styles/partials/_functions.scss: -------------------------------------------------------------------------------- 1 | // Custom functions 2 | 3 | @import 'vars'; 4 | @import '../../../node_modules/modularscale-sass/stylesheets/modularscale'; 5 | 6 | @function getFontSize($step) { 7 | @return ms($step, 16px, $minor-third); 8 | } 9 | 10 | @function getColor($name) { 11 | @return map-get($colors, $name); 12 | } 13 | -------------------------------------------------------------------------------- /examples/getting-started/src/index.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | 3 | function component() { 4 | const element = document.createElement('div'); 5 | 6 | // Lodash, now imported by this script 7 | element.innerHTML = _.join(['Hello', 'webpack'], ' '); 8 | 9 | return element; 10 | } 11 | 12 | document.body.appendChild(component()); 13 | -------------------------------------------------------------------------------- /jest.config.mjs: -------------------------------------------------------------------------------- 1 | import jestConfig from 'jest-config'; 2 | export default { 3 | verbose: true, 4 | transform: {}, 5 | moduleFileExtensions: [...jestConfig.defaults.moduleFileExtensions, 'mjs'], 6 | testMatch: [ 7 | '**/__tests__/**/*.[jt]s?(x)', 8 | '**/?(*.)+(spec|test).[tj]s?(x)', 9 | '**/*.test.mjs', 10 | ], 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/Print/PrintScript.js: -------------------------------------------------------------------------------- 1 | const printScript = ` 2 | window.matchMedia('print').addListener(function(mql) { 3 | if (!mql.matches) { 4 | window.close(); 5 | } 6 | }); 7 | window.print(); 8 | `; 9 | export default function PrintScript() { 10 | return ; 11 | } 12 | -------------------------------------------------------------------------------- /src/styles/icons/magnifying-glass.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env", 4 | [ 5 | "@babel/preset-react", 6 | { 7 | "runtime": "automatic" 8 | } 9 | ] 10 | ], 11 | "plugins": ["@babel/plugin-proposal-class-properties"], 12 | "env": { 13 | "development": { 14 | "plugins": ["react-refresh/babel"] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.vale/proselint/DateRedundancy.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'a.m.' is always morning; 'p.m.' is always night." 3 | ignorecase: true 4 | level: error 5 | nonword: true 6 | tokens: 7 | - '\d{1,2} ?a\.?m\.? in the morning' 8 | - '\d{1,2} ?p\.?m\.? in the evening' 9 | - '\d{1,2} ?p\.?m\.? at night' 10 | - '\d{1,2} ?p\.?m\.? in the afternoon' 11 | -------------------------------------------------------------------------------- /examples/module-federation/app2/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const App = () => { 4 | return ( 5 |
11 |

App 2

12 |
13 | ) 14 | } 15 | 16 | export default App; 17 | 18 | -------------------------------------------------------------------------------- /src/utilities/list2Tree/findTopLevel.test.js: -------------------------------------------------------------------------------- 1 | const findTopLevel = require('./findTopLevel'); 2 | describe('findTopLevel', () => { 3 | test('should return level 1', () => { 4 | expect(findTopLevel([{ level: 1 }, { level: 2 }])).toBe(1); 5 | }); 6 | test('should be undefined', () => { 7 | expect(findTopLevel([])).toBeUndefined(); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /src/components/Page/AdjacentPages.scss: -------------------------------------------------------------------------------- 1 | .adjacent-links { 2 | display: flex; 3 | padding: 30px 0; 4 | justify-content: space-between; 5 | &__prev { 6 | margin-right: auto; 7 | } 8 | &__next { 9 | margin-left: auto; 10 | } 11 | &__link { 12 | font-size: 1.125rem; 13 | } 14 | &__label--next { 15 | text-align: right; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/components/Splash/second/left.mdx: -------------------------------------------------------------------------------- 1 | **[Without config](https://youtu.be/3Nv9muOkb6k?t=21293)** or provide custom **webpack.config.js** 2 | 3 | ```js 4 | const path = require('path'); 5 | 6 | module.exports = { 7 | entry: './src/index.js', 8 | output: { 9 | path: path.resolve(__dirname, 'dist'), 10 | filename: 'bundle.js', 11 | }, 12 | }; 13 | ``` 14 | -------------------------------------------------------------------------------- /src/utilities/flatten-content-tree.mjs: -------------------------------------------------------------------------------- 1 | export default (tree) => { 2 | let paths = []; 3 | 4 | const crawl = (node) => { 5 | if ('url' in node) { 6 | paths.push(node.url); 7 | } 8 | 9 | if ('children' in node) { 10 | node.children.map(crawl); 11 | } 12 | }; 13 | 14 | tree.children.map(crawl); 15 | 16 | return paths; 17 | }; 18 | -------------------------------------------------------------------------------- /src/utilities/find-files-in-dist.js: -------------------------------------------------------------------------------- 1 | // grab .css files from ssg run 2 | const fs = require('fs'); 3 | 4 | module.exports = function (fileSuffixes = []) { 5 | const filesInDist = fs.readdirSync('./dist'); 6 | return fileSuffixes.length 7 | ? filesInDist.filter((file) => 8 | fileSuffixes.find((suffix) => file.endsWith(suffix)) 9 | ) 10 | : []; 11 | }; 12 | -------------------------------------------------------------------------------- /src/utilities/list2Tree/findTopLevel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Find the minimum level in the anchors 3 | */ 4 | module.exports = function findTopLevel(anchors = []) { 5 | if (anchors.length === 0) return; 6 | let result = 99; 7 | for (const anchor of anchors) { 8 | if (anchor.level < result) { 9 | result = anchor.level; 10 | } 11 | } 12 | return result; 13 | }; 14 | -------------------------------------------------------------------------------- /examples/module-federation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "module-federation", 3 | "private": true, 4 | "workspaces": { 5 | "packages": [ 6 | "app1", 7 | "app2" 8 | ] 9 | }, 10 | "scripts": { 11 | "start": "lerna run --parallel start", 12 | "build": "lerna run build" 13 | }, 14 | "devDependencies": { 15 | "lerna": "^4.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/components/Container/Container.jsx: -------------------------------------------------------------------------------- 1 | import './Container.scss'; 2 | import PropTypes from 'prop-types'; 3 | Container.propTypes = { 4 | className: PropTypes.string, 5 | children: PropTypes.node, 6 | }; 7 | export default function Container(props = {}) { 8 | let { className = '' } = props; 9 | 10 | return
{props.children}
; 11 | } 12 | -------------------------------------------------------------------------------- /src/components/Shield/Shield.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | const Shield = (props) => ( 3 | webpack shield 7 | ); 8 | Shield.propTypes = { 9 | content: PropTypes.string, 10 | label: PropTypes.string, 11 | }; 12 | export default Shield; 13 | -------------------------------------------------------------------------------- /src/utilities/get-adjacent-pages/index.mjs: -------------------------------------------------------------------------------- 1 | export default function getAdjacentPages(haystack, needle, by = 'url') { 2 | let previous, next; 3 | const findMe = haystack.findIndex((page) => page[by] === needle[by]); 4 | if (findMe !== -1) { 5 | previous = haystack[findMe - 1]; 6 | next = haystack[findMe + 1]; 7 | } 8 | return { 9 | previous, 10 | next, 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Top-most EditorConfig file 2 | root = true 3 | 4 | # AutoFormat All Files 5 | [*] 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | # Format Source Code 10 | [*.{md,mdx,js,jsx,json,scss,hbs}] 11 | charset = utf-8 12 | indent_style = space 13 | indent_size = 2 14 | quote_type = single 15 | 16 | # Format Configs 17 | [.eslintignore,*rc] 18 | indent_style = space 19 | indent_size = 2 20 | -------------------------------------------------------------------------------- /cypress/e2e/toggle-dark-mode.cy.js: -------------------------------------------------------------------------------- 1 | describe('Toggle dark mode', () => { 2 | it('should toggle .dark class for html element', () => { 3 | cy.visit('/'); 4 | 5 | const selector = '[data-testid="hello-darkness"]'; 6 | 7 | cy.get(selector).click(); 8 | cy.get('html').should('have.class', 'dark'); 9 | 10 | cy.get(selector).click(); 11 | cy.get('html').should('not.have.class', 'dark'); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /sitemap-ignore.json: -------------------------------------------------------------------------------- 1 | [ 2 | "app-shell/index.html", 3 | "appcache/manifest.html", 4 | "printable/index.html", 5 | "api/printable/index.html", 6 | "concepts/printable/index.html", 7 | "configuration/printable/index.html", 8 | "contribute/printable/index.html", 9 | "guides/printable/index.html", 10 | "migrate/printable/index.html", 11 | "loaders/printable/index.html", 12 | "plugins/printable/index.html" 13 | ] 14 | -------------------------------------------------------------------------------- /src/styles/icons/exit-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vale/proselint/Spelling.yml: -------------------------------------------------------------------------------- 1 | extends: consistency 2 | message: "Inconsistent spelling of '%s'." 3 | level: error 4 | ignorecase: true 5 | either: 6 | advisor: adviser 7 | centre: center 8 | colour: color 9 | emphasise: emphasize 10 | finalise: finalize 11 | focussed: focused 12 | labour: labor 13 | learnt: learned 14 | organise: organize 15 | organised: organized 16 | organising: organizing 17 | recognise: recognize 18 | -------------------------------------------------------------------------------- /cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress'); 2 | 3 | module.exports = defineConfig({ 4 | video: false, 5 | e2e: { 6 | // We've imported your old cypress plugins here. 7 | // You may want to clean this up later by importing these. 8 | setupNodeEvents(on, config) { 9 | return require('./cypress/plugins/index.js')(on, config); 10 | }, 11 | baseUrl: 'http://localhost:4200', 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /src/components/Configuration/Configuration.scss: -------------------------------------------------------------------------------- 1 | .shadow { 2 | overflow: visible; 3 | border-radius: 4px; 4 | box-shadow: -1px 1px 10px 0 rgba(255, 255, 255, 0.44); 5 | 6 | pre.inline { 7 | padding: 0; 8 | display: block; 9 | } 10 | } 11 | 12 | .shadow > .markdown { 13 | max-height: 48vh !important; 14 | overflow: auto; 15 | } 16 | 17 | .inline { 18 | padding-right: 15px !important; 19 | margin: 0 !important; 20 | } 21 | -------------------------------------------------------------------------------- /src/components/mdxComponents/Link.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import { Link } from 'react-router-dom'; 3 | LinkComponent.propTypes = { 4 | href: PropTypes.string.isRequired, 5 | }; 6 | export default function LinkComponent(props) { 7 | // if it's internal link 8 | // use Link instead 9 | if (props.href.startsWith('/')) { 10 | return ; 11 | } 12 | return ; 13 | } 14 | -------------------------------------------------------------------------------- /src/styles/icons/hamburger.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/styles/icons/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD002": false, 4 | "MD004": { "style": "dash" }, 5 | "MD007": { "indent": 2 }, 6 | "MD013": { "line_length": 600, "code_blocks": false }, 7 | "MD024": { 8 | "siblings_only": true 9 | }, 10 | "MD026": false, 11 | "MD029": { "style": "ordered" }, 12 | "MD033": false, 13 | "MD034": false, 14 | "MD036": false, 15 | "MD041": false, 16 | "no-hard-tabs": false, 17 | "whitespace": false 18 | } 19 | -------------------------------------------------------------------------------- /src/remark-plugins/remark-remove-heading-id/index.mjs: -------------------------------------------------------------------------------- 1 | import { visit } from 'unist-util-visit'; 2 | export default function () { 3 | return function transformer(ast) { 4 | visit(ast, 'heading', visitor); 5 | }; 6 | function visitor(node) { 7 | if (node.data && node.data.id) { 8 | delete node.data.id; 9 | } 10 | if (node.data && node.data.hProperties && node.data.hProperties.id) { 11 | delete node.data.hProperties.id; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | name: 'Dependency Review' 2 | on: [pull_request] 3 | 4 | permissions: 5 | contents: read 6 | 7 | jobs: 8 | dependency-review: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: 'Checkout Repository' 12 | uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 13 | - name: 'Dependency Review' 14 | uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2 15 | -------------------------------------------------------------------------------- /src/components/PageNotFound/PageNotFound.jsx: -------------------------------------------------------------------------------- 1 | import { Link } from 'react-router-dom'; 2 | 3 | // Styles 4 | import './PageNotFound.scss'; 5 | 6 | export default function PageNotFound() { 7 | return ( 8 |
9 |

Page Not Found

10 |

Oops! The page you are looking for has been removed or relocated.

11 | 12 | Go to Homepage 13 | 14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /cypress/e2e/check-sub-navigation.cy.js: -------------------------------------------------------------------------------- 1 | describe('Detect sub navigation', () => { 2 | it('should show sub navigation', () => { 3 | cy.visit('/concepts/'); 4 | 5 | const selector = '[data-testid="sub-navigation"]'; 6 | 7 | cy.get(selector).should('exist'); 8 | }); 9 | 10 | it('should not show sub navigation', () => { 11 | cy.visit('/'); 12 | 13 | const selector = '[data-testid="sub-navigation"]'; 14 | 15 | cy.get(selector).should('not.exist'); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /cypress/e2e/client-side-redirection.cy.js: -------------------------------------------------------------------------------- 1 | describe('Redirect on client side', () => { 2 | it('should redirect', () => { 3 | const target = '/configuration/other-options/#cache'; 4 | cy.visit(target); 5 | 6 | cy.url().should('include', '/configuration/cache/'); 7 | }); 8 | it('should not redirect', () => { 9 | cy.visit('/concepts/entry-points/#multi-page-application'); 10 | cy.url().should( 11 | 'include', 12 | '/concepts/entry-points/#multi-page-application' 13 | ); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /examples/module-federation/README.md: -------------------------------------------------------------------------------- 1 | # Module Federation 2 | 3 | ## How to use 4 | 5 | Run the following commands in the root directory. 6 | 7 | ```bash 8 | yarn 9 | yarn start 10 | ``` 11 | 12 | Both `app1` and `app2` are independently deployed apps: 13 | 14 | - `app1`: http://localhost:3001 15 | - `app2`: http://localhost:3002 16 | 17 | Check out this link below for more examples: 18 | 19 | [https://github.com/module-federation/module-federation-examples](https://github.com/module-federation/module-federation-examples) 20 | -------------------------------------------------------------------------------- /src/components/Site/clientSideRedirections.js: -------------------------------------------------------------------------------- 1 | // RedirectWebpackPlugin won't work for URI fragments 2 | // hence we redirect them with client side script 3 | export default function (location) { 4 | // cache options were splitted into a separate page 5 | // see https://github.com/webpack/webpack.js.org/pull/5146 6 | if ( 7 | location.pathname === '/configuration/other-options/' && 8 | location.hash.startsWith('#cache') 9 | ) { 10 | return `/configuration/cache/${location.hash}`; 11 | } 12 | return false; 13 | } 14 | -------------------------------------------------------------------------------- /src/utilities/test-local-storage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Test if localStorage is enabled. 3 | * 4 | * {@link https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js} 5 | * @return {undefined|boolean} Returns false on error. 6 | */ 7 | module.exports = function () { 8 | const test = 'localStorageTest'; 9 | try { 10 | localStorage.setItem(test, test); 11 | localStorage.removeItem(test); 12 | // eslint-disable-next-line no-unused-vars 13 | } catch (e) { 14 | return false; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /cypress/e2e/click-menu-scroll-top.cy.js: -------------------------------------------------------------------------------- 1 | describe('Click menu', () => { 2 | it('scroll to top when menu clicked', () => { 3 | cy.visit('/concepts/modules/'); 4 | // scroll to Contributors section 5 | // note that there's no hash in url 6 | cy.get('[data-testid="contributors"]').scrollIntoView(); 7 | 8 | const selector = '.sidebar-item__title[href="/concepts/modules/"]'; 9 | 10 | cy.get(selector).click(); 11 | cy.window().then((win) => { 12 | expect(win.scrollY).to.equal(0); 13 | }); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /src/utilities/yaml-headmatter.mjs: -------------------------------------------------------------------------------- 1 | export default function yamlHeadmatter(fields) { 2 | let ret = '---\n'; 3 | 4 | Object.keys(fields).map((field) => { 5 | if (field === 'contributors') { 6 | if(fields[field].length) { 7 | ret += `${field}:\n`; 8 | fields[field].forEach((contributor) => { 9 | ret += ` - ${contributor}\n`; 10 | }); 11 | } 12 | } else { 13 | ret += `${field}: ${fields[field]}\n`; 14 | } 15 | }); 16 | 17 | ret = `${ret}---\n`; 18 | 19 | return ret; 20 | }; 21 | -------------------------------------------------------------------------------- /src/content/plugins/NoEmitOnErrorsPlugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: NoEmitOnErrorsPlugin 3 | group: webpack 4 | contributors: 5 | - jeffin 6 | - chenxsan 7 | - snitin315 8 | --- 9 | 10 | The `NoEmitOnErrorsPlugin` allows you to avoid emitting assets when there are any errors. Enabled by default, you can disable using [`optimization.emitOnErrors`](/configuration/optimization/#optimizationemitonerrors) 11 | 12 | **webpack.config.js** 13 | 14 | ```javascript 15 | module.exports = { 16 | plugins: [new webpack.NoEmitOnErrorsPlugin()], 17 | }; 18 | ``` 19 | -------------------------------------------------------------------------------- /src/styles/partials/_mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin break($size: medium) { 2 | @media (min-width: map-get($screens, $size)) { 3 | @content; 4 | } 5 | } 6 | 7 | @mixin control-overflow { 8 | overflow: hidden; 9 | white-space: nowrap; 10 | text-overflow: ellipsis; 11 | } 12 | 13 | @mixin fontantialias($on) { 14 | @if $on == true { 15 | -webkit-font-smoothing: antialiased; 16 | -moz-osx-font-smoothing: grayscale; 17 | } @else { 18 | -webkit-font-smoothing: subpixel-antialiased; 19 | -moz-osx-font-smoothing: auto; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/getting-started/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getting-started-using-a-configuration", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1", 7 | "build": "webpack", 8 | "start": "serve dist" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "MIT", 13 | "dependencies": { 14 | "lodash": "^4.17.21" 15 | }, 16 | "devDependencies": { 17 | "serve": "^12.0.0", 18 | "webpack": "^5.38.1", 19 | "webpack-cli": "^4.7.2" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | open-pull-requests-limit: 10 6 | schedule: 7 | interval: "weekly" 8 | labels: 9 | - "dependencies" 10 | ignore: 11 | - dependency-name: "react" 12 | - dependency-name: "react-dom" 13 | groups: 14 | dependencies: 15 | patterns: 16 | - "*" 17 | # Maintain dependencies for GitHub Actions 18 | - package-ecosystem: "github-actions" 19 | directory: "/" 20 | schedule: 21 | interval: "weekly" -------------------------------------------------------------------------------- /examples/module-federation/app1/src/App.js: -------------------------------------------------------------------------------- 1 | import React, {Suspense} from "react"; 2 | const RemoteApp = React.lazy(() => import("app2/App")); 3 | 4 | const App = () => { 5 | return ( 6 |
7 |
13 |

App1

14 |
15 | 16 | 17 | 18 |
) 19 | } 20 | 21 | 22 | export default App; 23 | -------------------------------------------------------------------------------- /src/assets/icon-square-small.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/mdx-components.js: -------------------------------------------------------------------------------- 1 | import Badge from './components/Badge/Badge'; 2 | import LinkComponent from './components/mdxComponents/Link'; 3 | import StackBlitzPreview from './components/StackBlitzPreview/StackBlitzPreview'; 4 | import CodeBlockWithCopy from './components/CodeBlockWithCopy/CodeBlockWithCopy'; 5 | 6 | /** @returns {import('mdx/types.js').MDXComponents} */ 7 | export function useMDXComponents() { 8 | return { 9 | a: LinkComponent, 10 | Badge: Badge, 11 | StackBlitzPreview: StackBlitzPreview, 12 | pre: CodeBlockWithCopy, 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /src/remark-plugins/remark-slug/index.test.mjs: -------------------------------------------------------------------------------- 1 | import { remark } from 'remark'; 2 | import remarkHtml from 'remark-html'; 3 | import Plugin from './index.mjs'; 4 | describe('remark slug', () => { 5 | it('should add id', () => { 6 | remark() 7 | .use(Plugin) 8 | .use(remarkHtml) 9 | .process( 10 | `## hello world 11 | 12 | this is me. 13 | `, 14 | function (err, { value: contents }) { 15 | expect(err).toBeUndefined(); 16 | expect(contents).toMatchSnapshot(); 17 | } 18 | ); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /.vale/proselint/Oxymorons.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is an oxymoron." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - amateur expert 7 | - increasingly less 8 | - advancing backwards 9 | - alludes explicitly to 10 | - explicitly alludes to 11 | - totally obsolescent 12 | - completely obsolescent 13 | - generally always 14 | - usually always 15 | - increasingly less 16 | - build down 17 | - conspicuous absence 18 | - exact estimate 19 | - found missing 20 | - intense apathy 21 | - mandatory choice 22 | - organized mess 23 | -------------------------------------------------------------------------------- /src/assets/icon-square-big.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/icons/loading.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/content/plugins/min-chunk-size-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: MinChunkSizePlugin 3 | group: webpack 4 | contributors: 5 | - byzyk 6 | - erykpiast 7 | --- 8 | 9 | Keep chunk size above the specified limit by merging chunks that are smaller than the `minChunkSize`. 10 | 11 | ```js 12 | new webpack.optimize.MinChunkSizePlugin({ 13 | minChunkSize: 10000, // Minimum number of characters 14 | }); 15 | ``` 16 | 17 | ## Usage via CLI 18 | 19 | This plugin and it's options can also be invoked via the [CLI](/api/cli/): 20 | 21 | ```bash 22 | webpack --optimize-min-chunk-size 10000 23 | ``` 24 | -------------------------------------------------------------------------------- /.vale/proselint/RASSyndrome.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is redundant." 3 | level: error 4 | action: 5 | name: edit 6 | params: 7 | - split 8 | - ' ' 9 | - '0' 10 | tokens: 11 | - ABM missile 12 | - ACT test 13 | - ABM missiles 14 | - ABS braking system 15 | - ATM machine 16 | - CD disc 17 | - CPI Index 18 | - GPS system 19 | - GUI interface 20 | - HIV virus 21 | - ISBN number 22 | - LCD display 23 | - PDF format 24 | - PIN number 25 | - RAS syndrome 26 | - RIP in peace 27 | - please RSVP 28 | - SALT talks 29 | - SAT test 30 | - UPC codes 31 | -------------------------------------------------------------------------------- /src/content/plugins/prefetch-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: PrefetchPlugin 3 | group: webpack 4 | contributors: 5 | - skipjack 6 | - byzyk 7 | --- 8 | 9 | Prefetch normal module requests, causing them to be resolved and built before the first `import` or `require` of that module occurs. Using this plugin can boost performance. Try to profile the build first to determine clever prefetching points. 10 | 11 | ```javascript 12 | new webpack.PrefetchPlugin([context], request); 13 | ``` 14 | 15 | ## Options 16 | 17 | - `context`: An absolute path to a directory 18 | - `request`: A request string for a normal module 19 | -------------------------------------------------------------------------------- /src/components/Site/Site.scss: -------------------------------------------------------------------------------- 1 | .site { 2 | display: flex; 3 | flex-direction: column; 4 | min-height: 100vh; 5 | background: #ffffff; 6 | 7 | &__header { 8 | z-index: 100; 9 | position: fixed; 10 | width: 100%; 11 | } 12 | 13 | &__content { 14 | flex: 1 1 auto; 15 | position: relative; 16 | display: flex; 17 | margin-top: 110px; 18 | 19 | @media print { 20 | margin-top: 0px; 21 | } 22 | } 23 | 24 | &__sidebar { 25 | flex: 0 0 280px; 26 | } 27 | } 28 | 29 | @media print { 30 | header, 31 | nav, 32 | footer { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /.vale/proselint/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "jdkato", 3 | "description": "A Vale-compatible implementation of the proselint linter.", 4 | "email": "support@errata.ai", 5 | "lang": "en", 6 | "url": "https://github.com/errata-ai/proselint/releases/latest/download/proselint.zip", 7 | "feed": "https://github.com/errata-ai/proselint/releases.atom", 8 | "issues": "https://github.com/errata-ai/proselint/issues/new", 9 | "license": "BSD-3-Clause", 10 | "name": "proselint", 11 | "sources": ["https://github.com/amperser/proselint"], 12 | "vale_version": ">=1.0.0", 13 | "coverage": 0.0, 14 | "version": "0.1.0" 15 | } 16 | -------------------------------------------------------------------------------- /src/content/plugins/context-exclusion-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: ContextExclusionPlugin 3 | group: webpack 4 | contributors: 5 | - jeffin 6 | --- 7 | 8 | _Context_ refers to a [require with an expression](/guides/dependency-management/#require-with-expression) such as `require('./locale/' + name + '.json')`. 9 | 10 | The `ContextExclusionPlugin` allows you to exclude context. Provide RegExp as an argument when initializing the Plugin to exclude all context that matches it. 11 | 12 | **webpack.config.js** 13 | 14 | ```javascript 15 | module.exports = { 16 | plugins: [new webpack.ContextExclusionPlugin(/dont/)], 17 | }; 18 | ``` 19 | -------------------------------------------------------------------------------- /examples/module-federation/app2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app2", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "start": "webpack serve", 8 | "build": "webpack --mode production" 9 | }, 10 | "dependencies": { 11 | "react": "^17.0.2", 12 | "react-dom": "^17.0.2" 13 | }, 14 | "devDependencies": { 15 | "@babel/core": "^7.14.3", 16 | "@babel/preset-react": "^7.13.13", 17 | "babel-loader": "^8.2.2", 18 | "html-webpack-plugin": "^5.3.1", 19 | "webpack": "^5.38.1", 20 | "webpack-cli": "^4.7.2", 21 | "webpack-dev-server": "^4.0.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cypress/support/commands.js: -------------------------------------------------------------------------------- 1 | Cypress.Commands.add('isNotInViewport', (element) => { 2 | cy.get(element).then(($el) => { 3 | // we won't have horizontal scollbar 4 | const rect = $el[0].getBoundingClientRect(); 5 | if (rect.top < 0) { 6 | expect(rect.bottom).to.be.lessThan(0); 7 | } else { 8 | expect(rect.top).to.be.at.least(0); 9 | } 10 | }); 11 | }); 12 | 13 | Cypress.Commands.add('isInViewport', (element) => { 14 | cy.get(element).then(($el) => { 15 | const rect = $el[0].getBoundingClientRect(); 16 | 17 | expect(rect.top).to.be.at.least(0); 18 | expect(rect.left).to.be.at.least(0); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /src/assets/by.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/Link/Link.jsx: -------------------------------------------------------------------------------- 1 | import { Link as ReactRouterLink } from 'react-router-dom'; 2 | import PropTypes from 'prop-types'; 3 | 4 | const Link = ({ to = '', url, ...props }) => { 5 | if (url) to = url; 6 | 7 | // eslint-disable-next-line 8 | const { isActive, ...others } = props; 9 | if (to.startsWith('http') || to.startsWith('//')) { 10 | return ( 11 | 12 | ); 13 | } else { 14 | return ; 15 | } 16 | }; 17 | 18 | Link.propTypes = { 19 | to: PropTypes.string, 20 | url: PropTypes.string, 21 | }; 22 | 23 | export default Link; 24 | -------------------------------------------------------------------------------- /src/content/plugins/watch-ignore-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: WatchIgnorePlugin 3 | group: webpack 4 | contributors: 5 | - skipjack 6 | - byzyk 7 | - EugeneHlushko 8 | --- 9 | 10 | Ignore the specified files, i.e. those matching the provided paths or regular expressions, while in [watch mode](/configuration/watch). 11 | 12 | ```javascript 13 | new webpack.WatchIgnorePlugin({ paths }); 14 | ``` 15 | 16 | ## Options 17 | 18 | - `paths` (`Array`): A list of RegExps or absolute paths to directories or files that should be ignored. 19 | 20 | W> This plugin is deprecated in favor of [watchOptions.ignored](/configuration/watch/#watchoptionsignored) option. 21 | -------------------------------------------------------------------------------- /src/remark-plugins/remark-remove-heading-id/index.test.mjs: -------------------------------------------------------------------------------- 1 | import { remark } from 'remark'; 2 | import remarkHtml from 'remark-html'; 3 | import Plugin from './index.mjs'; 4 | import remarkSlug from '../remark-slug/index.mjs'; 5 | describe('customize blockquote', () => { 6 | it('should add id', () => { 7 | remark() 8 | .use(remarkSlug) 9 | .use(Plugin) 10 | .use(remarkHtml) 11 | .process( 12 | ` 13 | ## hello world 14 | 15 | this is me. 16 | `, 17 | function (err, { value: contents }) { 18 | expect(err).toBeUndefined(); 19 | expect(contents).toMatchSnapshot(); 20 | } 21 | ); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /examples/module-federation/app1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app1", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "start": "webpack serve", 8 | "build": "webpack --mode production" 9 | }, 10 | "dependencies": { 11 | "react": "^17.0.2", 12 | "react-dom": "^17.0.2" 13 | }, 14 | "devDependencies": { 15 | "@babel/core": "^7.14.3", 16 | "@babel/preset-react": "^7.13.13", 17 | "babel-loader": "^8.2.2", 18 | "external-remotes-plugin": "^1.0.0", 19 | "html-webpack-plugin": "^5.3.1", 20 | "webpack": "^5.38.1", 21 | "webpack-cli": "^4.7.2", 22 | "webpack-dev-server": "^4.0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.vale/proselint/LGBTTerms.yml: -------------------------------------------------------------------------------- 1 | extends: substitution 2 | message: "Consider using '%s' instead of '%s'." 3 | ignorecase: true 4 | action: 5 | name: replace 6 | swap: 7 | homosexual man: gay man 8 | homosexual men: gay men 9 | homosexual woman: lesbian 10 | homosexual women: lesbians 11 | homosexual people: gay people 12 | homosexual couple: gay couple 13 | sexual preference: sexual orientation 14 | (?:admitted homosexual|avowed homosexual): openly gay 15 | special rights: equal rights 16 | -------------------------------------------------------------------------------- /src/content/plugins/automatic-prefetch-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: AutomaticPrefetchPlugin 3 | group: webpack 4 | contributors: 5 | - sokra 6 | - EugeneHlushko 7 | --- 8 | 9 | The `AutomaticPrefetchPlugin` discovers **all modules** from the previous compilation upfront while watching for changes, trying to improve the incremental build times. Compared to [`PrefetchPlugin`](/plugins/prefetch-plugin/) which discovers a **single module** upfront. 10 | 11 | W> May or may not have a performance benefit since the incremental build times are pretty fast. 12 | 13 | **webpack.config.js** 14 | 15 | ```javascript 16 | module.exports = { 17 | // ... 18 | plugins: [new webpack.AutomaticPrefetchPlugin()], 19 | }; 20 | ``` 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Documentation_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation request 3 | about: Create a documentation request for a new feature or functionality change. 4 | --- 5 | 6 | **Feature to document** 7 | 8 | 9 | 10 | **Author(s)** 11 | 12 | 13 | 14 | **Additional information** 15 | 16 | 17 | 18 | [ ] I am willing to work on this issue and submit a pull request. 19 | -------------------------------------------------------------------------------- /cypress/support/e2e.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands'; 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /src/content/plugins/hot-module-replacement-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: HotModuleReplacementPlugin 3 | group: webpack 4 | contributors: 5 | - skipjack 6 | - byzyk 7 | - chenxsan 8 | - snitin315 9 | related: 10 | - title: Concepts - Hot Module Replacement 11 | url: /concepts/hot-module-replacement 12 | - title: API - Hot Module Replacement 13 | url: /api/hot-module-replacement 14 | --- 15 | 16 | Enables [Hot Module Replacement](/concepts/hot-module-replacement), otherwise known as HMR. 17 | 18 | W> HMR should **never** be used in production. 19 | 20 | ## Basic Usage 21 | 22 | Enabling HMR is straightforward and in most cases no options are necessary. 23 | 24 | ```javascript 25 | new webpack.HotModuleReplacementPlugin({ 26 | // Options... 27 | }); 28 | ``` 29 | -------------------------------------------------------------------------------- /.vale/proselint/CorporateSpeak.yml: -------------------------------------------------------------------------------- 1 | extends: existence 2 | message: "'%s' is corporate speak." 3 | ignorecase: true 4 | level: error 5 | tokens: 6 | - at the end of the day 7 | - back to the drawing board 8 | - hit the ground running 9 | - get the ball rolling 10 | - low-hanging fruit 11 | - thrown under the bus 12 | - think outside the box 13 | - let's touch base 14 | - get my manager's blessing 15 | - it's on my radar 16 | - ping me 17 | - i don't have the bandwidth 18 | - no brainer 19 | - par for the course 20 | - bang for your buck 21 | - synergy 22 | - move the goal post 23 | - apples to apples 24 | - win-win 25 | - circle back around 26 | - all hands on deck 27 | - take this offline 28 | - drill-down 29 | - elephant in the room 30 | - on my plate 31 | -------------------------------------------------------------------------------- /src/styles/tailwind.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | /* @import "tailwindcss/components"; */ 3 | @import 'tailwindcss/utilities'; 4 | 5 | /* doc search */ 6 | :root { 7 | --docsearch-primary-color: #1d78c1 !important; 8 | } 9 | .DocSearch-Button { 10 | @apply bg-transparent lg:bg-gray-500 transition duration-200 !important; 11 | } 12 | .DocSearch-Button-Placeholder { 13 | @apply hidden lg:font-light lg:text-sm lg:block lg:text-gray-200 lg:dark:text-gray-300 transition duration-200 !important; 14 | } 15 | .DocSearch-Button:hover .DocSearch-Button-Placeholder { 16 | @apply lg:text-gray-100 !important; 17 | } 18 | .DocSearch-Button-Keys { 19 | @apply hidden lg:flex !important; 20 | } 21 | .DocSearch-Button .DocSearch-Search-Icon { 22 | @apply text-white lg:text-gray-100 !important; 23 | } 24 | -------------------------------------------------------------------------------- /cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | /// 2 | // *********************************************************** 3 | // This example plugins/index.js can be used to load plugins 4 | // 5 | // You can change the location of this file or turn off loading 6 | // the plugins file with the 'pluginsFile' configuration option. 7 | // 8 | // You can read more here: 9 | // https://on.cypress.io/plugins-guide 10 | // *********************************************************** 11 | 12 | // This function is called when a project is opened or re-opened (e.g. due to 13 | // the project's config changing) 14 | 15 | /** 16 | * @type {Cypress.PluginConfig} 17 | */ 18 | module.exports = () => { 19 | // `on` is used to hook into various events Cypress emits 20 | // `config` is the resolved Cypress config 21 | }; 22 | -------------------------------------------------------------------------------- /src/styles/partials/_vars.scss: -------------------------------------------------------------------------------- 1 | $colors: ( 2 | malibu: #8dd6f9, 3 | denim: #175d96, 4 | fiord: #465e69, 5 | elephant: #2b3a42, 6 | white: #ffffff, 7 | concrete: #f2f2f2, 8 | alto: #dedede, 9 | dusty-grey: #777676, 10 | dove-grey: #666666, 11 | emperor: #535353, 12 | mine-shaft: #333333, 13 | ); 14 | 15 | $screens: ( 16 | xlarge: 1525px, 17 | large: 1024px, 18 | medium: 768px, 19 | ); 20 | 21 | $font-stack-body: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 22 | 'Segoe UI', Helvetica, Arial, sans-serif; 23 | $font-stack-heading: 'Source Serif Pro', ui-serif, Georgia, Cambria, 24 | 'Times New Roman', Times, serif; 25 | $font-stack-code: 'Source Code Pro', Consolas, 'Liberation Mono', Menlo, Courier, 26 | monospace; 27 | 28 | $text-color-highlight: lighten(map-get($colors, denim), 5%); 29 | -------------------------------------------------------------------------------- /.github/actions/webpack-persistent-cache/action.yml: -------------------------------------------------------------------------------- 1 | name: Webpack persistent cache 2 | description: Cache webpack's persistent cache between builds. 3 | 4 | outputs: 5 | cache-hit: 6 | description: Whether the cache was restored from the cache key. 7 | value: ${{ steps.build-webpack-persistent-cache.outputs.cache-hit }} 8 | 9 | runs: 10 | using: composite 11 | steps: 12 | - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 13 | id: build-webpack-persistent-cache 14 | with: 15 | path: node_modules/.cache 16 | key: build-${{ hashFiles('**/webpack.*.mjs') }}-${{ hashFiles('**/yarn.lock') }} 17 | restore-keys: |- 18 | build-${{ hashFiles('**/webpack.*.mjs') }}-${{ hashFiles('**/yarn.lock') }} 19 | build-${{ hashFiles('**/webpack.*.mjs') }}- 20 | -------------------------------------------------------------------------------- /src/index.jsx: -------------------------------------------------------------------------------- 1 | // Import External Dependencies 2 | import ReactDOM from 'react-dom'; 3 | import { BrowserRouter } from 'react-router-dom'; 4 | import AnalyticsRouter from './AnalyticsRouter.jsx'; 5 | 6 | import App from './App.jsx'; 7 | 8 | import './styles/tailwind.css'; 9 | // Import helpers 10 | import isClient from './utilities/is-client'; 11 | import { HelmetProvider } from 'react-helmet-async'; 12 | 13 | const isProduction = process.env.NODE_ENV === 'production'; 14 | 15 | const Router = isProduction ? AnalyticsRouter : BrowserRouter; 16 | const render = isProduction ? ReactDOM.hydrate : ReactDOM.render; 17 | 18 | // Client Side Rendering 19 | if (isClient) { 20 | render( 21 | 22 | 23 | 24 | 25 | , 26 | document.getElementById('root') 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /src/content/license.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: License 3 | sort: 5 4 | contributors: 5 | - EugeneHlushko 6 | - pranshuchittora 7 | --- 8 | 9 | ## webpack 10 | 11 | Webpack is [MIT licensed](https://github.com/webpack/webpack/blob/main/LICENSE). 12 | 13 | ## webpack logo and icon 14 | 15 | The webpack logo and icon are under a different license which can be 16 | found [here](https://github.com/webpack/media). 17 | 18 | ## webpack documentation 19 | 20 | The content on [https://webpack.js.org/](https://webpack.js.org/) is available under [Creative Commons BY 4.0](https://creativecommons.org/licenses/by/4.0/) license meaning attribution is required should you use the content elsewhere. 21 | 22 | ## webpack code samples 23 | 24 | The code samples use [CC0 1.0 Universal (CC0 1.0) (Public Domain)](https://creativecommons.org/publicdomain/zero/1.0/) and you are free to use them as you like. 25 | -------------------------------------------------------------------------------- /src/components/StackBlitzPreview/StackBlitzPreview.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import openButton from '../../assets/open-in-stackblitz-button.svg'; 3 | 4 | StackBlitzPreview.propTypes = { 5 | description: PropTypes.string, 6 | example: PropTypes.string, 7 | }; 8 | 9 | export default function StackBlitzPreview(props = {}) { 10 | const { 11 | example = '', 12 | description = 'Check out this guide live on StackBlitz.', 13 | } = props; 14 | 15 | const url = `https://stackblitz.com/github/webpack/webpack.js.org/tree/main/examples/${example}`; 16 | 17 | return ( 18 | 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /src/remark-plugins/remark-custom-asides/index.test.mjs: -------------------------------------------------------------------------------- 1 | import { remark } from 'remark'; 2 | import remarkHtml from 'remark-html'; 3 | import Plugin from './index.mjs'; 4 | describe('customize blockquote', () => { 5 | it('should transform W> into aside of warning', () => { 6 | remark() 7 | .use(Plugin, { 8 | mapping: { 9 | 'W>': 'warning', 10 | }, 11 | }) 12 | .use(remarkHtml, { 13 | sanitize: false 14 | }) 15 | .process( 16 | ` 17 | W> hello world 18 | `, 19 | function (err, { value: contents }) { 20 | expect(err).toBeUndefined(); 21 | expect(contents).toContain('