Easy to maintain open source documentation websites. https://docusaurus.io/
Go to file
Reece Dunham 05e7250c08
feat(v2): Webpack 5, PostCSS 8 (#4089)
* Initial webpack 5 work

* It works on my machine (lol)

* Committing a bit more work

* It works - sorta

* Update packages/docusaurus/package.json

* at least fix prettier /shrug

* making more progress. build should work now, css stuff is still a bit broken

* Terser things

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Working on things

* Vendor webpack

* Repair chunks, and tests

* Rerun prettier

* Re-add client prefetching

* Update snapshots

* Update snapshots

* I hope this works

* Remove redundant dev server code

* relock

* Trying to reduce memory usage and fix things

* Dead code elim

* Search bar works!!!

* Prefetching should work again

* lock

* ts issue

* Repair snapshot

* Run prettier

* Fix the CI for now

* fix lint-prettier

* clean-css works, now for the other one

* Fix lockfile

* Fixes prettier

* Other css minification works!!!

* Add clean-css options, fix webpack versions

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Fix tests and several of the webpack loaders

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Re-add support for simple css minifier

* Update other related dependencies

* Fix lockfile

* Dev server fixups

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Simplify css things

* Update webpack, try with postcss 7

* Other cssnano repairs

* fix lockfile

* Clean up the babel preset

* Fix lockfile

* Bump RL SSR version

* Fix the build errors

* Lockfile fix

* It works again

* webpack 5 should close compiler after run

* add proper webpack5 persistent caching config

* upgrade webpack deps again

* reduce build perf timeouts to avoid build time regressions

* test if incremental build can run on netlify

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* test

* test

* test

* test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* fix existsSync() calls

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* migrate existing stats.warningsFilter to config.ignoreWarnings

* remove stats from postBuild lifecycle data doc, as it is likely unused (we'll add it back if someone ask for it)

* improve build.ts TS issues + move some sync code to async

* cleanup TS of start.ts

* fix TS error

* fix TS issues

* fix TS issues

* fix ts error

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* script cleanup

* script cleanup

* re-enable @typescript-eslint/ban-ts-comment

* Deprecate getCacheLoader / getBabelLoader but keep retrocompatibility

* useless TS

* fix and comment gca(chunkName) prefetching function

* remove deprecated mainTemplate.requireFn

* temporarily use react-loadable-ssr-addon-v5-slorber until PR merged: https://github.com/facebook/docusaurus/pull/4089

* comment unsafeCache option

* add explicit and more precise webpack targets

* splitChunks, use new type: "css/mini-extract" as it seems recommended for webpack 5

* webpack error handling:
- log error.details as documented
- keep using react-dev-utils/formatWebpackMessages for now

* fix webpack5 warnings for evalSourceMapMiddleware.js

* typo

* rename webpackHotDevClient

* make all modifications of react-dev-utils explicit with a comment

* revert LogPlugin adapter

* loader-utils update

* add useful share cache comment

* add useful comments regarding the null-loader used in SSR for css files

* upgrade webpack-merge in a retrocompatible way

* use MiniCssExtractPlugin.emit false as recommended

* use @docusaurus/responsive-loader

* revert MiniCssExtractPlugin esModule: false change

* add link to PR for custom CleanWebpackPlugin

* pwa: add fallback to env variable or webpack 5 fails to build

* upgrade to CssMinimizerPlugin 2.0

* only build en locale for windows tests

* line breaks between errors

* add useful comment

* Fix e2e tests with Yarn2 not finding new init template dependencies

* fix bad import

* disable browserslist target as webpack already tries to use browserlists if a config is found, and it is a problem for existing sites

* webpack5 TS fixes

* fix getMinimizer order (even if it does not work yet)

* update postcss to v8, fix cssnano minimizer errors

* add NavbarItem position to types (useful for QuestDB site upgrade to Webpack5)

* add webpack cache env variable to reduce risk of webpack 5 adoption

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-30 18:06:53 +02:00
.devcontainer fix(v2): fix too strict markdown frontmatter validation (#4654) 2021-04-21 16:19:55 +02:00
.github feat(v2): Webpack 5, PostCSS 8 (#4089) 2021-04-30 18:06:53 +02:00
.husky chore(v2): upgrade dependencies + require Node 12 (#4223) 2021-02-18 15:12:42 +01:00
__tests__ chore(v2): Fix more linter warnings (#4450) 2021-03-18 18:05:09 +01:00
admin chore(v2): fix yarn2 end2end test by using lerna publish --exact (#4613) 2021-04-14 17:25:50 +02:00
examples chore(v2): update examples to use alpha73 (#4631) 2021-04-16 14:08:23 +02:00
jest refactor(v2): i18n cleanups / refactors (#4405) 2021-03-15 18:02:53 +01:00
packages feat(v2): Webpack 5, PostCSS 8 (#4089) 2021-04-30 18:06:53 +02:00
website feat(v2): Webpack 5, PostCSS 8 (#4089) 2021-04-30 18:06:53 +02:00
website-1.x chore(v2): prepare v2.0.0.alpha-74 release (#4690) 2021-04-27 16:38:56 +02:00
.editorconfig Standardize editor configs for cross-platform development (#628) 2018-05-03 10:23:21 -07:00
.eslintignore chore(v1): add missing generated files from v1 to ignores (#3872) 2020-12-03 18:13:44 +01:00
.eslintrc.js refactor(v2): correct client types and type aliases (#4451) 2021-03-19 11:32:38 +01:00
.gitattributes Add .webp to .gitattributes for ignoring 2018-05-03 13:13:03 -07:00
.gitignore chore: simplify CI setup (#4447) 2021-03-18 17:40:28 +01:00
.gitpod.yml feat: add Gitpod config for Docusaurus 2 (#2201) 2020-01-12 12:33:21 +08:00
.nvmrc refactor(v2): i18n cleanups / refactors (#4405) 2021-03-15 18:02:53 +01:00
.prettierignore chore(v2): prepare v2.0.0.alpha-73 release (#4628) 2021-04-16 12:48:10 +02:00
.prettierrc chore(v2): update Prettier config (#2542) 2020-04-05 23:51:47 +08:00
.stylelintrc.js fix(v2): improve stylelint copyright header rule (#2363) 2020-03-07 11:49:52 +08:00
.watchmanconfig misc(v2): make watchman config valid 2020-03-24 12:17:00 +08:00
CHANGELOG-1.x.md chore: prepare v1-v2 domain switch (#4475) 2021-03-22 20:26:47 +01:00
CHANGELOG.md chore(v2): prepare v2.0.0.alpha-74 release (#4690) 2021-04-27 16:38:56 +02:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md 2018-07-31 19:49:46 -07:00
CONTRIBUTING.md chore: rename v2.docusaurus.io urls after domain switch + redirect + cleanups (#4490) 2021-03-22 20:57:49 +01:00
LICENSE chore: yearless copyright headers for source code (#2320) 2020-02-25 23:12:28 +08:00
LICENSE-docs Docusaurus documentation license (#118) 2017-10-06 12:59:01 -07:00
README.md docs: Update README badges (#4573) 2021-04-05 18:58:28 +02:00
babel.config.js chore: yearless copyright headers for source code (#2320) 2020-02-25 23:12:28 +08:00
crowdin-v1.yml fix(v1): Fix v1 site deployment with Crowdin again... (#4410) 2021-03-12 11:41:53 +01:00
crowdin-v2.yaml docs(v2): i18n doc + polish (#4014) 2021-01-19 17:26:31 +01:00
generateExamples.js fix(v2): examples should use Node 14 by default on CodeSandbox + regen with alpha72 (#4574) 2021-04-07 18:28:06 +02:00
jest.config.js chore: simplify CI setup (#4447) 2021-03-18 17:40:28 +01:00
jest.config.v1.js chore: simplify CI setup (#4447) 2021-03-18 17:40:28 +01:00
lerna.json chore(v2): prepare v2.0.0.alpha-74 release (#4690) 2021-04-27 16:38:56 +02:00
package.json feat(v2): Webpack 5, PostCSS 8 (#4089) 2021-04-30 18:06:53 +02:00
tsconfig.json feat(v2): Webpack 5, PostCSS 8 (#4089) 2021-04-30 18:06:53 +02:00
yarn.lock feat(v2): Webpack 5, PostCSS 8 (#4089) 2021-04-30 18:06:53 +02:00

Docusaurus

Docusaurus

Twitter Follow npm version Github Actions status Github Actions status PRs Welcome Discord Chat code style: prettier Tested with Jest Gitpod Ready-to-Code Netlify Status CI Score

We are working hard on Docusaurus v2. If you are new to Docusaurus, try using the new version instead of v1. See the Docusaurus v2 website for more details.

Docusaurus v1 doc is available at v1.docusaurus.io

Introduction

Docusaurus is a project for building, deploying, and maintaining open source project websites easily.

Tip: use new.docusaurus.io to test Docusaurus immediately in CodeSandbox.

  • Simple to Start

Docusaurus is built in a way so that it can get running in as little time as possible. We've built Docusaurus to handle the website build process so you can focus on your project.

  • Localizable

Docusaurus ships with localization support via CrowdIn. Empower and grow your international community by translating your documentation.

  • Customizable

While Docusaurus ships with the key pages and sections you need to get started, including a home page, a docs section, a blog, and additional support pages, it is also customizable as well to ensure you have a site that is uniquely yours.

Installation

Use the initialization cli to create your site:

npx @docusaurus/init@latest init [name] [template]

Example:

npx @docusaurus/init@latest init my-website classic

Contributing

We've released Docusaurus because it helps us better scale and supports the many OSS projects at Facebook. We hope that other organizations can benefit from the project. We are thankful for any contributions from the community.

Code of Conduct

Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing guide

Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.

Beginner-friendly bugs

To help you get your feet wet and get you familiar with our contribution process, we have a list of beginner-friendly bugs that might contain smaller issues to tackle first. This is a great place to get started.

Contact

We have a few channels for contact:

  • Discord with two text channels:
    • #docusaurus-users for those using Docusaurus.
    • #docusaurus-dev for those wanting to contribute to the Docusaurus core.
  • @docusaurus on Twitter
  • GitHub Issues

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 Become a backer

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor

License

Docusaurus is MIT licensed.

The Docusaurus documentation (e.g., .md files in the /docs folder) is Creative Commons licensed.

Special thanks

BrowserStack logo

BrowserStack supports us with free access for open source.

Rocket Validator logo

Rocket Validator helps us find HTML markup or accessibility issues.