Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate md to mdx #5233

Merged
merged 57 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
5e13721
rename vote.md to vote.mdx
chenxsan Jul 24, 2021
c88538e
rename license.md to license.mdx
chenxsan Jul 24, 2021
f4b5b81
rename glossary.md to glossary.mdx
chenxsan Jul 24, 2021
c2fa1b7
rename comparison.md to .mdx
chenxsan Jul 24, 2021
ae98454
Merge branch 'master' into feature/migrate-md-to-mdx
chenxsan Jul 30, 2021
f4d5798
Merge branch 'master' into feature/migrate-md-to-mdx
chenxsan Aug 7, 2021
c72b803
rename html-webpack-plugin.md
chenxsan Aug 7, 2021
7bfee6d
rename automatic-prefetch-plugin.md
chenxsan Aug 7, 2021
42b094f
rename banner-plugin.md
chenxsan Aug 7, 2021
aaa66b0
rename commons-chunk-plugin.md
chenxsan Aug 7, 2021
37e126b
rename context-exclusion-plugin.md
chenxsan Aug 7, 2021
a0fbbe9
rename context-replacement-plugin.md
chenxsan Aug 8, 2021
faaa010
rename dll-plugin.md
chenxsan Aug 8, 2021
38ae652
rename environment-plugin.md
chenxsan Aug 8, 2021
abaeb43
rename eval-source-map-dev-tool-plugin.md
chenxsan Aug 8, 2021
965c7e5
rename hashed-module-ids-plugin.md
chenxsan Aug 8, 2021
6062305
rename hot-module-replacement-plugin.md
chenxsan Aug 8, 2021
eaf4b68
rename ignore-plugin.md
chenxsan Aug 8, 2021
5888c1a
rename index.md
chenxsan Aug 8, 2021
b11ba1c
rename limit-chunk-count-plugin.md
chenxsan Aug 8, 2021
7008e96
rename module-concatenation-plugin.md
chenxsan Aug 8, 2021
33003da
rename module-concatenation-plugin.md
chenxsan Aug 8, 2021
8060514
rename NoEmitOnErrorsPlugin.md
chenxsan Aug 8, 2021
f79e722
rename normal-module-replacement-plugin.md
chenxsan Aug 8, 2021
1f723f7
rename prefetch-plugin.md
chenxsan Aug 8, 2021
23875a7
rename profiling-plugin.md
chenxsan Aug 8, 2021
6adddcf
rename progress-plugin.md
chenxsan Aug 8, 2021
b536ee1
rename provide-plugin.md
chenxsan Aug 8, 2021
e7dbf83
rename source-map-dev-tool-plugin.md
chenxsan Aug 8, 2021
8cdcec2
rename split-chunks-plugin.md
chenxsan Aug 8, 2021
23ecedd
rename watch-ignore-plugin.md
chenxsan Aug 8, 2021
8be2b3d
rename 3.md and fix whitespaces
chenxsan Aug 8, 2021
76346fa
rename 4.md
chenxsan Aug 8, 2021
5f7f6cc
rename 5.md
chenxsan Aug 8, 2021
b2d47e4
rename index.md
chenxsan Aug 8, 2021
943ae1c
rename blogs
chenxsan Aug 8, 2021
1bebaef
rename api
chenxsan Aug 8, 2021
f0cebea
rename concepts
chenxsan Aug 8, 2021
5f8bc1a
fix proselint
chenxsan Aug 8, 2021
90887dd
rename why-webpack.md
chenxsan Aug 8, 2021
5c72fff
rename configuration
chenxsan Aug 8, 2021
2daec81
rename contribute
chenxsan Aug 8, 2021
f43ac57
rename guides
chenxsan Aug 8, 2021
2f58c58
rename branding.md
chenxsan Aug 9, 2021
4abb3a8
Revert "rename branding.md"
chenxsan Aug 9, 2021
d256dc3
rename printable.md
chenxsan Aug 9, 2021
20799a8
Revert "rename printable.md"
chenxsan Aug 9, 2021
194e266
rename index.md
chenxsan Aug 9, 2021
45a2281
Revert "Revert "rename branding.md""
chenxsan Aug 9, 2021
ed7f6f3
extract style
chenxsan Aug 9, 2021
9a7a3ea
Revert "Revert "rename printable.md""
chenxsan Aug 9, 2021
68aaf84
Revert "Revert "Revert "rename printable.md"""
chenxsan Aug 9, 2021
8f5c388
Merge branch 'master' into feature/migrate-md-to-mdx
chenxsan Aug 9, 2021
e33d611
Update src/content/concepts/configuration.mdx
chenxsan Aug 9, 2021
c108658
Merge branch 'master' into feature/migrate-md-to-mdx
chenxsan Aug 10, 2021
d14f38a
Merge branch 'master' into feature/migrate-md-to-mdx
chenxsan Aug 10, 2021
72506b1
rename to mdx
chenxsan Aug 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/BrandingSample.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import PropTypes from 'prop-types';
BrandingSample.propTypes = {
color: PropTypes.string.isRequired,
};
export default function BrandingSample({ color }) {
return <div style={{ backgroundColor: color }}>&nbsp;</div>;
}
2 changes: 1 addition & 1 deletion src/components/Site/Site.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function Site(props) {
*/
const _strip = (array) => {
let anchorTitleIndex = array.findIndex(
(item) => item.name.toLowerCase() === 'index.md'
(item) => item.name.toLowerCase() === 'index.mdx'
);

if (anchorTitleIndex !== -1) {
Expand Down
8 changes: 2 additions & 6 deletions src/components/Splash/Splash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PlaceholderComponent } from '../Placeholder/Placeholder';
import isClient from '../../utilities/is-client';

// Import Demo Content
import SplashContent from '../../content/index.md';
import SplashContent from '../../content/index.mdx';

// Load Styling
import './Splash.scss';
Expand Down Expand Up @@ -55,11 +55,7 @@ const Splash = () => {
<div className="splash__section splash__section--dark page__content">
<Container>
<Markdown>
<div
dangerouslySetInnerHTML={{
__html: SplashContent,
}}
/>
<SplashContent />
</Markdown>
</Container>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/components/Splash/first/left.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**src/index.js**

```js
import bar from './bar.js';

bar();
```
7 changes: 7 additions & 0 deletions src/components/Splash/first/right.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**src/bar.js**

```js
export default function bar() {
//
}
```
13 changes: 13 additions & 0 deletions src/components/Splash/second/left.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**[Without config](https://youtu.be/3Nv9muOkb6k?t=21293)** or provide custom **webpack.config.js**

```js
const path = require('path');

module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
};
```
15 changes: 15 additions & 0 deletions src/components/Splash/second/right.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**page.html**

```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
...
</head>
<body>
...
<script src="dist/bundle.js"></script>
</body>
</html>
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Behavior can be changed with `Rule.parser.requireInclude` to allowed, deprecated

### Automatic Node.js Polyfills Removed

In the early days, webpack's aim was to allow running most Node.js modules in the browser, but the module landscape changed and many module uses are now written mainly for frontend purposes. webpack <= 4 ships with polyfills for many of the Node.js core modules, which are automatically applied once a module uses any of the core modules (i.e. the `crypto` module).
In the early days, webpack's aim was to allow running most Node.js modules in the browser, but the module landscape changed and many module uses are now written mainly for frontend purposes. webpack &lt;= 4 ships with polyfills for many of the Node.js core modules, which are automatically applied once a module uses any of the core modules (i.e. the `crypto` module).

While this makes using modules written for Node.js easier, it adds these huge polyfills to the bundle. In many cases these polyfills are unnecessary.

Expand Down
File renamed without changes.
69 changes: 49 additions & 20 deletions src/content/branding.md → src/content/branding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ contributors:
- byzyk
---

import BrandingSample from '../components/BrandingSample.jsx';

Here you can find **webpack** project brand guidelines, assets, and license. See our official [media repository](https://github.com/webpack/media) for more information and to find the [license](https://github.com/webpack/media/blob/master/LICENSE) that governs this work. Click any of the images to download them.

## The Name
Expand All @@ -18,16 +20,27 @@ Webpack can be written with a capital W when used at the start of a sentence, ot

The webpack logo should be placed on a white background with enough space around it like this:

<img src="https://raw.githubusercontent.com/webpack/media/master/logo/logo-on-white-bg.png" alt="webpack logo default with proper spacing on light background" />
<img
src="https://raw.githubusercontent.com/webpack/media/master/logo/logo-on-white-bg.png"
alt="webpack logo default with proper spacing on light background"
/>

[svg](https://github.com/webpack/media/blob/master/logo/logo-on-white-bg.svg) | [png](https://github.com/webpack/media/blob/master/logo/logo-on-white-bg.png) | [jpg](https://github.com/webpack/media/blob/master/logo/logo-on-white-bg.jpg)

Double the size of the inner dark blue cube to get an idea how much space the logo should have.

For dark backgrounds, you can use the negative version of the logo:

<div style="display: block; background: #111;">
<img src="https://raw.githubusercontent.com/webpack/media/master/logo/logo-on-dark-bg.png" alt="webpack logo default with proper spacing on light background" />
export const style = {
display: 'block',
background: '#111',
};

<div style={style}>
<img
src="https://raw.githubusercontent.com/webpack/media/master/logo/logo-on-dark-bg.png"
alt="webpack logo default with proper spacing on light background"
/>
</div>

[svg](https://github.com/webpack/media/blob/master/logo/logo-on-dark-bg.svg) | [png](https://github.com/webpack/media/blob/master/logo/logo-on-dark-bg.png) | [jpg](https://github.com/webpack/media/blob/master/logo/logo-on-dark-bg.jpg)
Expand All @@ -38,43 +51,59 @@ T> Please use the **icon + text** whenever possible.

**The icon is designed to be used in layout-constrained areas. As previously stated, please prefer icon + text.**

<img src="https://raw.githubusercontent.com/webpack/media/master/logo/icon.png" width="250" alt="icon example">
<img
src="https://raw.githubusercontent.com/webpack/media/master/logo/icon.png"
width="250"
alt="icon example"
/>

[svg](https://github.com/webpack/media/blob/master/logo/icon.svg) | [png](https://github.com/webpack/media/blob/master/logo/icon.png) | [jpg](https://github.com/webpack/media/blob/master/logo/icon.jpg)

Square-sized icon for bigger areas (like avatars or profile pictures):

<img src="https://raw.githubusercontent.com/webpack/media/master/logo/icon-square-big.png" width="250" alt="icon square big example">
<img
src="https://raw.githubusercontent.com/webpack/media/master/logo/icon-square-big.png"
width="250"
alt="icon square big example"
/>

[svg](https://github.com/webpack/media/blob/master/logo/icon-square-big.svg) | [png](https://github.com/webpack/media/blob/master/logo/icon-square-big.png) | [jpg](https://github.com/webpack/media/blob/master/logo/icon-square-big.jpg)

Square-sized icon for smaller areas (like favicons):

<img src="https://raw.githubusercontent.com/webpack/media/master/logo/icon-square-small.png" width="50" alt="icon square small example">
<img
src="https://raw.githubusercontent.com/webpack/media/master/logo/icon-square-small.png"
width="50"
alt="icon square small example"
/>

[svg](https://github.com/webpack/media/blob/master/logo/icon-square-small.svg) | [png](https://github.com/webpack/media/blob/master/logo/icon-square-small.png) | [jpg](https://github.com/webpack/media/blob/master/logo/icon-square-small.jpg)

T> For those of you following our guidelines and have gotten this far, we've made a special smaller size image used especially for custom emoji (like in a slack or gitter channel ;))

<img src="/assets/icon-square-small-slack.png" width="50" alt="icon square small example">
<img
src="/assets/icon-square-small-slack.png"
width="50"
alt="icon square small example"
/>

## Color Palette

The following colors are used throughout the site in various combinations and on our fancy clothing line launched with the help of [Open Collective](https://opencollective.com/) and [Threadless](https://medium.com/u/840563ee2a56) over at the [official webpack store](https://webpack.threadless.com/collections/the-final-release-collection/)!

| Color Name | HEX Code | RGB Code | Sample |
| ------------ | ------------- | -------------------- | ---------------------------------------------------- |
| Malibu: | HEX `#8dd6f9` | `rgb: 141, 214, 249` | <div style="background-color: #8dd6f9;">&nbsp;</div> |
| Denim: | HEX `#1d78c1` | `rgb: 29, 120, 193` | <div style="background-color: #1d78c1;">&nbsp;</div> |
| Fiord: | HEX `#465E69` | `rgb: 70, 94, 105` | <div style="background-color: #465E69;">&nbsp;</div> |
| Outer Space: | HEX `#2B3A42` | `rgb: 43, 58, 66` | <div style="background-color: #2B3A42;">&nbsp;</div> |
| White: | HEX `#ffffff` | `rgb: 255, 255, 255` | <div style="background-color: #ffffff;">&nbsp;</div> |
| Concrete: | HEX `#f2f2f2` | `rgb: 242, 242, 242` | <div style="background-color: #f2f2f2;">&nbsp;</div> |
| Alto: | HEX `#dedede` | `rgb: 222, 222, 222` | <div style="background-color: #dedede;">&nbsp;</div> |
| Dusty Gray: | HEX `#999999` | `rgb: 153, 153, 153` | <div style="background-color: #999999;">&nbsp;</div> |
| Dove Gray: | HEX `#666666` | `rgb: 102, 102, 102` | <div style="background-color: #666666;">&nbsp;</div> |
| Emperor: | HEX `#535353` | `rgb: 83, 83, 83` | <div style="background-color: #535353;">&nbsp;</div> |
| Mine Shaft: | HEX `#333333` | `rgb: 51, 51, 51` | <div style="background-color: #333333;">&nbsp;</div> |
| Color Name | HEX Code | RGB Code | Sample |
| ------------ | ------------- | -------------------- | ---------------------------------- |
| Malibu: | HEX `#8dd6f9` | `rgb: 141, 214, 249` | <BrandingSample color='#8dd6f9' /> |
| Denim: | HEX `#1d78c1` | `rgb: 29, 120, 193` | <BrandingSample color='#1d78c1' /> |
| Fiord: | HEX `#465E69` | `rgb: 70, 94, 105` | <BrandingSample color='#465E69' /> |
| Outer Space: | HEX `#2B3A42` | `rgb: 43, 58, 66` | <BrandingSample color='#2B3A42' /> |
| White: | HEX `#ffffff` | `rgb: 255, 255, 255` | <BrandingSample color='#ffffff' /> |
| Concrete: | HEX `#f2f2f2` | `rgb: 242, 242, 242` | <BrandingSample color='#f2f2f2' /> |
| Alto: | HEX `#dedede` | `rgb: 222, 222, 222` | <BrandingSample color='#dedede' /> |
| Dusty Gray: | HEX `#999999` | `rgb: 153, 153, 153` | <BrandingSample color='#999999' /> |
| Dove Gray: | HEX `#666666` | `rgb: 102, 102, 102` | <BrandingSample color='#666666' /> |
| Emperor: | HEX `#535353` | `rgb: 83, 83, 83` | <BrandingSample color='#535353' /> |
| Mine Shaft: | HEX `#333333` | `rgb: 51, 51, 51` | <BrandingSample color='#333333' /> |

In addition, you can grab the following file types directly from these links:

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ You may have noticed that few webpack configurations look exactly alike. This is

Because it's a standard Node.js CommonJS module, you **can do the following**:

- import other files via `require(...)`
- import other files via `require(...)

`
chenxsan marked this conversation as resolved.
Show resolved Hide resolved
- use utilities on npm via `require(...)`
- use JavaScript control flow expressions, e.g. the `?:` operator
- use constants or variables for often used values
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const pluginName = 'ConsoleLogOnBuildWebpackPlugin';
class ConsoleLogOnBuildWebpackPlugin {
apply(compiler) {
compiler.hooks.run.tap(pluginName, (compilation) => {
console.log('The webpack build process is starting!!!');
console.log('The webpack build process is starting!');
});
}
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ contributors:
The people who contribute to webpack do so for the love of open source, our users and ecosystem, and most importantly, pushing the web forward together. Because of our [Open Collective](https://opencollective.com/webpack) model for funding and transparency, we are able to funnel support and funds through contributors, dependent projects, and the contributor and core teams. To make a donation, click the button below...

<div align="center">
<a href="https://opencollective.com/webpack/donate" target="_blank">
<img src="https://opencollective.com/webpack/donate/[email protected]?color=blue" width=300 />
</a>

<a
href="https://opencollective.com/webpack/donate"
target="_blank"
rel="noopenner noreferrer"
>
<img
src="https://opencollective.com/webpack/donate/[email protected]?color=blue"
width={300}
/>
</a>

</div>

But what is the return on the investment?
Expand Down Expand Up @@ -52,8 +61,6 @@ The remainder of this section of the site is dedicated to developers such as you

CTO's, VPs, and owners can help too!

<!-- add slides here regarding monetary value/dev time/tooling -->

webpack is an all-in-one tool for bundling your code. It can handle fonts, images, data and more with the help of community-driven plugins and loaders. Having all of your assets be handled by one tool is immensely helpful, as you or your team can spend less time making sure a machine with many moving parts is working correctly and more time building your product.

### Sponsorship
Expand All @@ -69,8 +76,6 @@ You can also encourage your developers to contribute to the ecosystem by open-so

To anyone else who is interested in helping our mission – e.g. venture capitalists, government entities, digital agencies, etc. – we would love for you to work with us, one of the top npm packages, to improve your product! Please don't hesitate to reach out with questions.

<!-- add slides here -->

## Pull requests

Documentation of webpack features and changes is now being updated as webpack evolves. An automated issue creation integration was established and proven to be effective in the recent years.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contributors:
- astonizer
---

If you've been following the guides from the start, you will now have a small project that shows "Hello webpack". Now let's try to incorporate some other assets, like images, to see how they can be handled.
If you've been following the guides from the start, you will now have a small project that shows "Hello webpack". Now let's try to incorporate some other assets, like images, to see how they can be handled.

Prior to webpack, front-end developers would use tools like [grunt](https://gruntjs.com/) and [gulp](https://gulpjs.com/) to process these assets and move them from their `/src` folder into their `/dist` or `/build` directory. The same idea was used for JavaScript modules, but tools like webpack will **dynamically bundle** all dependencies (creating what's known as a [dependency graph](/concepts/dependency-graph)). This is great because every module now _explicitly states its dependencies_ and we'll avoid bundling modules that aren't in use.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ webpack-demo
entry: './src/index.js',
plugins: [
new HtmlWebpackPlugin({
-       title: 'Output Management',
+       title: 'Caching',
- title: 'Output Management',
+ title: 'Caching',
}),
],
output: {
Expand Down Expand Up @@ -103,7 +103,7 @@ As we learned in [code splitting](/guides/code-splitting), the [`SplitChunksPlug
entry: './src/index.js',
plugins: [
new HtmlWebpackPlugin({
      title: 'Caching',
title: 'Caching',
}),
],
output: {
Expand Down Expand Up @@ -146,7 +146,7 @@ This can be done by using the [`cacheGroups`](/plugins/split-chunks-plugin/#spli
entry: './src/index.js',
plugins: [
new HtmlWebpackPlugin({
      title: 'Caching',
title: 'Caching',
}),
],
output: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contributors:
- chenxsan
- Adarah
related:
- title: <link rel=prefetch/preload”> in webpack
- title: &lt;link rel="prefetch/preload"&gt; in webpack
url: https://medium.com/webpack/link-rel-prefetch-preload-in-webpack-51a52358f84c
- title: Preload, Prefetch And Priorities in Chrome
url: https://medium.com/reloading/preload-prefetch-and-priorities-in-chrome-776165961bbf
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
78 changes: 0 additions & 78 deletions src/content/index.md

This file was deleted.

Loading