@docusaurus/core 2.0.0-beta.12faed89d → 2.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/beforeCli.js +46 -22
- package/bin/docusaurus.js +42 -44
- package/lib/babel/preset.d.ts +6 -0
- package/lib/babel/preset.js +3 -3
- package/lib/choosePort.js +19 -20
- package/lib/client/.eslintrc.js +0 -1
- package/lib/client/App.js +12 -22
- package/lib/client/LinksCollector.d.ts +2 -2
- package/lib/client/LinksCollector.js +4 -8
- package/lib/client/PendingNavigation.d.ts +24 -1
- package/lib/client/PendingNavigation.js +1 -1
- package/lib/client/baseUrlIssueBanner/BaseUrlIssueBanner.d.ts +5 -0
- package/lib/client/client-lifecycles-dispatcher.d.ts +2 -2
- package/lib/client/client-lifecycles-dispatcher.js +0 -2
- package/lib/client/docusaurus.d.ts +6 -0
- package/lib/client/docusaurus.js +11 -19
- package/lib/client/exports/BrowserOnly.js +5 -3
- package/lib/client/exports/ErrorBoundary.d.ts +18 -0
- package/lib/client/exports/ErrorBoundary.js +35 -0
- package/lib/client/exports/Interpolate.js +12 -15
- package/lib/client/exports/Link.js +9 -9
- package/lib/client/exports/Translate.d.ts +2 -2
- package/lib/client/exports/Translate.js +13 -9
- package/lib/client/exports/browserContext.d.ts +11 -0
- package/lib/client/exports/browserContext.js +21 -0
- package/lib/client/exports/constants.js +1 -11
- package/lib/client/exports/{context.d.ts → docusaurusContext.d.ts} +5 -3
- package/lib/client/exports/docusaurusContext.js +25 -0
- package/lib/client/exports/useBaseUrl.js +2 -4
- package/lib/client/exports/useDocusaurusContext.js +2 -7
- package/lib/client/exports/useGlobalData.js +1 -5
- package/lib/client/exports/{context.js → useIsBrowser.d.ts} +1 -2
- package/lib/{webpack/sharedModuleAliases.d.ts → client/exports/useIsBrowser.js} +5 -4
- package/lib/client/flat.d.ts +2 -1
- package/lib/client/flat.js +7 -9
- package/lib/client/normalizeLocation.d.ts +1 -3
- package/lib/client/prefetch.js +0 -1
- package/lib/client/serverEntry.js +20 -42
- package/lib/client/theme-fallback/Error/index.js +47 -0
- package/lib/client/theme-fallback/Layout/index.js +1 -1
- package/lib/client/theme-fallback/Loading/index.js +2 -2
- package/lib/client/theme-fallback/Root/index.js +1 -3
- package/lib/commands/build.js +39 -44
- package/lib/commands/clear.d.ts +6 -0
- package/lib/commands/clear.js +17 -18
- package/lib/commands/commandUtils.d.ts +6 -0
- package/lib/commands/commandUtils.js +7 -7
- package/lib/commands/deploy.d.ts +3 -0
- package/lib/commands/deploy.js +99 -64
- package/lib/commands/external.js +4 -4
- package/lib/commands/serve.js +12 -18
- package/lib/commands/start.js +98 -86
- package/lib/commands/swizzle.js +42 -51
- package/lib/commands/writeHeadingIds.d.ts +9 -6
- package/lib/commands/writeHeadingIds.js +33 -34
- package/lib/commands/writeTranslations.js +31 -11
- package/lib/server/brokenLinks.js +13 -17
- package/lib/server/client-modules/index.js +1 -3
- package/lib/server/config.js +4 -4
- package/lib/server/configValidation.d.ts +1 -1
- package/lib/server/configValidation.js +14 -7
- package/lib/server/duplicateRoutes.js +8 -2
- package/lib/server/html-tags/htmlTags.js +5 -6
- package/lib/server/html-tags/index.js +2 -2
- package/lib/server/i18n.js +16 -16
- package/lib/server/index.js +132 -59
- package/lib/server/loadSetup.js +3 -3
- package/lib/server/moduleShorthand.d.ts +9 -0
- package/lib/server/moduleShorthand.js +42 -0
- package/lib/server/plugins/applyRouteTrailingSlash.js +1 -1
- package/lib/server/plugins/index.d.ts +1 -1
- package/lib/server/plugins/index.js +25 -21
- package/lib/server/plugins/init.js +9 -12
- package/lib/server/plugins/pluginIds.js +6 -4
- package/lib/server/presets/index.js +12 -12
- package/lib/server/routes.js +9 -11
- package/lib/server/themes/alias.d.ts +1 -0
- package/lib/server/themes/alias.js +21 -12
- package/lib/server/themes/index.d.ts +1 -1
- package/lib/server/themes/index.js +22 -23
- package/lib/server/translations/translations.d.ts +6 -0
- package/lib/server/translations/translations.js +19 -26
- package/lib/server/translations/translationsExtractor.d.ts +7 -1
- package/lib/server/translations/translationsExtractor.js +66 -59
- package/lib/server/utils.d.ts +8 -2
- package/lib/server/utils.js +8 -10
- package/lib/server/versions/__fixtures__/dummy-plugin.d.ts +0 -0
- package/lib/server/versions/__tests/index.test.js +5 -5
- package/lib/server/versions/index.js +6 -6
- package/lib/webpack/base.js +14 -16
- package/lib/webpack/client.js +9 -18
- package/lib/webpack/plugins/CleanWebpackPlugin.js +4 -11
- package/lib/webpack/plugins/LogPlugin.js +5 -6
- package/lib/webpack/plugins/WaitPlugin.js +4 -4
- package/lib/webpack/server.js +9 -9
- package/lib/webpack/utils.d.ts +0 -22
- package/lib/webpack/utils.js +37 -134
- package/package.json +55 -50
- package/lib/.tsbuildinfo +0 -1
- package/lib/client/.tsbuildinfo +0 -1
- package/lib/commands/buildRemoteBranchUrl.d.ts +0 -7
- package/lib/commands/buildRemoteBranchUrl.js +0 -27
- package/lib/constants.d.ts +0 -18
- package/lib/constants.js +0 -23
- package/lib/webpack/react-dev-utils-webpack5/README.md +0 -11
- package/lib/webpack/react-dev-utils-webpack5/evalSourceMapMiddleware.js +0 -57
- package/lib/webpack/react-dev-utils-webpack5/formatWebpackMessages.js +0 -138
- package/lib/webpack/react-dev-utils-webpack5/webpackHotDevClient.js +0 -285
- package/lib/webpack/sharedModuleAliases.js +0 -18
- package/tsconfig.client.json +0 -13
- package/tsconfig.json +0 -13
package/lib/webpack/utils.js
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getMinimizer = exports.getHttpsConfig = exports.
|
|
9
|
+
exports.getMinimizer = exports.getHttpsConfig = exports.compile = exports.applyConfigurePostCss = exports.applyConfigureWebpack = exports.getCustomizableJSLoader = exports.getBabelOptions = exports.getCustomBabelConfigFilePath = exports.getStyleLoaders = void 0;
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
|
-
const mini_css_extract_plugin_1 = tslib_1.__importDefault(require("mini-css-extract-plugin"));
|
|
11
|
+
const mini_css_extract_plugin_1 = (0, tslib_1.__importDefault)(require("mini-css-extract-plugin"));
|
|
12
12
|
const webpack_merge_1 = require("webpack-merge");
|
|
13
|
-
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
14
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
15
|
-
const terser_webpack_plugin_1 = tslib_1.__importDefault(require("terser-webpack-plugin"));
|
|
16
|
-
const css_minimizer_webpack_plugin_1 = tslib_1.__importDefault(require("css-minimizer-webpack-plugin"));
|
|
17
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
18
|
-
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
19
|
-
const
|
|
20
|
-
const
|
|
13
|
+
const webpack_1 = (0, tslib_1.__importDefault)(require("webpack"));
|
|
14
|
+
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
15
|
+
const terser_webpack_plugin_1 = (0, tslib_1.__importDefault)(require("terser-webpack-plugin"));
|
|
16
|
+
const css_minimizer_webpack_plugin_1 = (0, tslib_1.__importDefault)(require("css-minimizer-webpack-plugin"));
|
|
17
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
18
|
+
const crypto_1 = (0, tslib_1.__importDefault)(require("crypto"));
|
|
19
|
+
const logger_1 = (0, tslib_1.__importDefault)(require("@docusaurus/logger"));
|
|
20
|
+
const utils_1 = require("@docusaurus/utils");
|
|
21
21
|
const lodash_1 = require("lodash");
|
|
22
22
|
// Utility method to get style loaders
|
|
23
23
|
function getStyleLoaders(isServer, cssOptions = {}) {
|
|
@@ -66,7 +66,7 @@ function getStyleLoaders(isServer, cssOptions = {}) {
|
|
|
66
66
|
// https://github.com/facebook/create-react-app/issues/2677
|
|
67
67
|
ident: 'postcss',
|
|
68
68
|
plugins: [
|
|
69
|
-
// eslint-disable-next-line
|
|
69
|
+
// eslint-disable-next-line global-require
|
|
70
70
|
require('autoprefixer'),
|
|
71
71
|
],
|
|
72
72
|
},
|
|
@@ -76,7 +76,7 @@ function getStyleLoaders(isServer, cssOptions = {}) {
|
|
|
76
76
|
}
|
|
77
77
|
exports.getStyleLoaders = getStyleLoaders;
|
|
78
78
|
function getCustomBabelConfigFilePath(siteDir) {
|
|
79
|
-
const customBabelConfigurationPath = path_1.default.join(siteDir,
|
|
79
|
+
const customBabelConfigurationPath = path_1.default.join(siteDir, utils_1.BABEL_CONFIG_FILE_NAME);
|
|
80
80
|
return fs_extra_1.default.existsSync(customBabelConfigurationPath)
|
|
81
81
|
? customBabelConfigurationPath
|
|
82
82
|
: undefined;
|
|
@@ -112,16 +112,16 @@ const getCustomizableJSLoader = (jsLoader = 'babel') => ({ isServer, babelOption
|
|
|
112
112
|
: jsLoader(isServer);
|
|
113
113
|
exports.getCustomizableJSLoader = getCustomizableJSLoader;
|
|
114
114
|
// TODO remove this before end of 2021?
|
|
115
|
-
const warnBabelLoaderOnce = lodash_1.memoize(
|
|
116
|
-
|
|
115
|
+
const warnBabelLoaderOnce = (0, lodash_1.memoize)(() => {
|
|
116
|
+
logger_1.default.warn `Docusaurus plans to support multiple JS loader strategies (Babel, esbuild...): code=${'getBabelLoader(isServer)'} is now deprecated in favor of code=${'getJSLoader(isServer)'}.`;
|
|
117
117
|
});
|
|
118
118
|
const getBabelLoaderDeprecated = function getBabelLoaderDeprecated(isServer, babelOptions) {
|
|
119
119
|
warnBabelLoaderOnce();
|
|
120
120
|
return getDefaultBabelLoader({ isServer, babelOptions });
|
|
121
121
|
};
|
|
122
122
|
// TODO remove this before end of 2021 ?
|
|
123
|
-
const warnCacheLoaderOnce = lodash_1.memoize(
|
|
124
|
-
|
|
123
|
+
const warnCacheLoaderOnce = (0, lodash_1.memoize)(() => {
|
|
124
|
+
logger_1.default.warn `Docusaurus uses Webpack 5 and code=${'getCacheLoader()'} usage is now deprecated.`;
|
|
125
125
|
});
|
|
126
126
|
function getCacheLoaderDeprecated() {
|
|
127
127
|
warnCacheLoaderOnce();
|
|
@@ -140,18 +140,17 @@ function applyConfigureWebpack(configureWebpack, config, isServer, jsLoader, con
|
|
|
140
140
|
// Export some utility functions
|
|
141
141
|
const utils = {
|
|
142
142
|
getStyleLoaders,
|
|
143
|
-
getJSLoader: exports.getCustomizableJSLoader(jsLoader),
|
|
143
|
+
getJSLoader: (0, exports.getCustomizableJSLoader)(jsLoader),
|
|
144
144
|
getBabelLoader: getBabelLoaderDeprecated,
|
|
145
145
|
getCacheLoader: getCacheLoaderDeprecated,
|
|
146
146
|
};
|
|
147
147
|
if (typeof configureWebpack === 'function') {
|
|
148
148
|
const { mergeStrategy, ...res } = configureWebpack(config, isServer, utils, content);
|
|
149
149
|
if (res && typeof res === 'object') {
|
|
150
|
-
// @ts-expect-error: annoying error due to enums: https://github.com/survivejs/webpack-merge/issues/179
|
|
151
150
|
const customizeRules = mergeStrategy !== null && mergeStrategy !== void 0 ? mergeStrategy : {};
|
|
152
|
-
return webpack_merge_1.mergeWithCustomize({
|
|
153
|
-
customizeArray: webpack_merge_1.customizeArray(customizeRules),
|
|
154
|
-
customizeObject: webpack_merge_1.customizeObject(customizeRules),
|
|
151
|
+
return (0, webpack_merge_1.mergeWithCustomize)({
|
|
152
|
+
customizeArray: (0, webpack_merge_1.customizeArray)(customizeRules),
|
|
153
|
+
customizeObject: (0, webpack_merge_1.customizeObject)(customizeRules),
|
|
155
154
|
})(config, res);
|
|
156
155
|
}
|
|
157
156
|
}
|
|
@@ -176,24 +175,24 @@ function applyConfigurePostCss(configurePostCss, config) {
|
|
|
176
175
|
else if (Array.isArray(entry.use)) {
|
|
177
176
|
entry.use
|
|
178
177
|
.filter((u) => typeof u === 'object')
|
|
179
|
-
.forEach(overridePostCssOptions);
|
|
178
|
+
.forEach((rule) => overridePostCssOptions(rule));
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
|
-
(_b = (_a = config.module) === null || _a === void 0 ? void 0 : _a.rules) === null || _b === void 0 ? void 0 : _b.forEach(overridePostCssOptions);
|
|
181
|
+
(_b = (_a = config.module) === null || _a === void 0 ? void 0 : _a.rules) === null || _b === void 0 ? void 0 : _b.forEach((rule) => overridePostCssOptions(rule));
|
|
183
182
|
return config;
|
|
184
183
|
}
|
|
185
184
|
exports.applyConfigurePostCss = applyConfigurePostCss;
|
|
186
185
|
function compile(config) {
|
|
187
186
|
return new Promise((resolve, reject) => {
|
|
188
|
-
const compiler = webpack_1.default(config);
|
|
187
|
+
const compiler = (0, webpack_1.default)(config);
|
|
189
188
|
compiler.run((err, stats) => {
|
|
190
189
|
var _a;
|
|
191
190
|
if (err) {
|
|
192
|
-
|
|
191
|
+
logger_1.default.error(err.stack || err);
|
|
193
192
|
// @ts-expect-error: see https://webpack.js.org/api/node/#error-handling
|
|
194
193
|
if (err.details) {
|
|
195
194
|
// @ts-expect-error: see https://webpack.js.org/api/node/#error-handling
|
|
196
|
-
|
|
195
|
+
logger_1.default.error(err.details);
|
|
197
196
|
}
|
|
198
197
|
reject(err);
|
|
199
198
|
}
|
|
@@ -204,14 +203,14 @@ function compile(config) {
|
|
|
204
203
|
}
|
|
205
204
|
if (errorsWarnings && (stats === null || stats === void 0 ? void 0 : stats.hasWarnings())) {
|
|
206
205
|
(_a = errorsWarnings.warnings) === null || _a === void 0 ? void 0 : _a.forEach((warning) => {
|
|
207
|
-
|
|
206
|
+
logger_1.default.warn(`${warning}`);
|
|
208
207
|
});
|
|
209
208
|
}
|
|
210
209
|
// Webpack 5 requires calling close() so that persistent caching works
|
|
211
210
|
// See https://github.com/webpack/webpack.js.org/pull/4775
|
|
212
211
|
compiler.close((errClose) => {
|
|
213
212
|
if (errClose) {
|
|
214
|
-
|
|
213
|
+
logger_1.default.error(`Error while closing Webpack compiler: ${errClose}`);
|
|
215
214
|
reject(errClose);
|
|
216
215
|
}
|
|
217
216
|
else {
|
|
@@ -222,130 +221,31 @@ function compile(config) {
|
|
|
222
221
|
});
|
|
223
222
|
}
|
|
224
223
|
exports.compile = compile;
|
|
225
|
-
// Inspired by https://github.com/gatsbyjs/gatsby/blob/8e6e021014da310b9cc7d02e58c9b3efe938c665/packages/gatsby/src/utils/webpack-utils.ts#L447
|
|
226
|
-
function getFileLoaderUtils() {
|
|
227
|
-
// files/images < 10kb will be inlined as base64 strings directly in the html
|
|
228
|
-
const urlLoaderLimit = 10000;
|
|
229
|
-
// defines the path/pattern of the assets handled by webpack
|
|
230
|
-
const fileLoaderFileName = (folder) => `${constants_1.OUTPUT_STATIC_ASSETS_DIR_NAME}/${folder}/[name]-[hash].[ext]`;
|
|
231
|
-
const loaders = {
|
|
232
|
-
file: (options) => {
|
|
233
|
-
return {
|
|
234
|
-
loader: require.resolve(`file-loader`),
|
|
235
|
-
options: {
|
|
236
|
-
name: fileLoaderFileName(options.folder),
|
|
237
|
-
},
|
|
238
|
-
};
|
|
239
|
-
},
|
|
240
|
-
url: (options) => {
|
|
241
|
-
return {
|
|
242
|
-
loader: require.resolve(`url-loader`),
|
|
243
|
-
options: {
|
|
244
|
-
limit: urlLoaderLimit,
|
|
245
|
-
name: fileLoaderFileName(options.folder),
|
|
246
|
-
fallback: require.resolve(`file-loader`),
|
|
247
|
-
},
|
|
248
|
-
};
|
|
249
|
-
},
|
|
250
|
-
// TODO find a better solution to avoid conflicts with the ideal-image plugin
|
|
251
|
-
// TODO this may require a little breaking change for ideal-image users?
|
|
252
|
-
// Maybe with the ideal image plugin, all md images should be "ideal"?
|
|
253
|
-
// This is used to force url-loader+file-loader on markdown images
|
|
254
|
-
// https://webpack.js.org/concepts/loaders/#inline
|
|
255
|
-
inlineMarkdownImageFileLoader: `!url-loader?limit=${urlLoaderLimit}&name=${fileLoaderFileName('images')}&fallback=file-loader!`,
|
|
256
|
-
inlineMarkdownLinkFileLoader: `!file-loader?name=${fileLoaderFileName('files')}!`,
|
|
257
|
-
};
|
|
258
|
-
const rules = {
|
|
259
|
-
/**
|
|
260
|
-
* Loads image assets, inlines images via a data URI if they are below
|
|
261
|
-
* the size threshold
|
|
262
|
-
*/
|
|
263
|
-
images: () => {
|
|
264
|
-
return {
|
|
265
|
-
use: [loaders.url({ folder: 'images' })],
|
|
266
|
-
test: /\.(ico|jpg|jpeg|png|gif|webp)(\?.*)?$/,
|
|
267
|
-
};
|
|
268
|
-
},
|
|
269
|
-
fonts: () => {
|
|
270
|
-
return {
|
|
271
|
-
use: [loaders.url({ folder: 'fonts' })],
|
|
272
|
-
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
273
|
-
};
|
|
274
|
-
},
|
|
275
|
-
/**
|
|
276
|
-
* Loads audio and video and inlines them via a data URI if they are below
|
|
277
|
-
* the size threshold
|
|
278
|
-
*/
|
|
279
|
-
media: () => {
|
|
280
|
-
return {
|
|
281
|
-
use: [loaders.url({ folder: 'medias' })],
|
|
282
|
-
test: /\.(mp4|webm|ogv|wav|mp3|m4a|aac|oga|flac)$/,
|
|
283
|
-
};
|
|
284
|
-
},
|
|
285
|
-
svg: () => {
|
|
286
|
-
return {
|
|
287
|
-
test: /\.svg?$/,
|
|
288
|
-
oneOf: [
|
|
289
|
-
{
|
|
290
|
-
use: [
|
|
291
|
-
{
|
|
292
|
-
loader: '@svgr/webpack',
|
|
293
|
-
options: {
|
|
294
|
-
prettier: false,
|
|
295
|
-
svgo: true,
|
|
296
|
-
svgoConfig: {
|
|
297
|
-
plugins: [{ removeViewBox: false }],
|
|
298
|
-
},
|
|
299
|
-
titleProp: true,
|
|
300
|
-
ref: ![path_1.default],
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
// We don't want to use SVGR loader for non-React source code
|
|
305
|
-
// ie we don't want to use SVGR for CSS files...
|
|
306
|
-
issuer: {
|
|
307
|
-
and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
|
|
308
|
-
},
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
use: [loaders.url({ folder: 'images' })],
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
|
-
};
|
|
315
|
-
},
|
|
316
|
-
otherAssets: () => {
|
|
317
|
-
return {
|
|
318
|
-
use: [loaders.file({ folder: 'files' })],
|
|
319
|
-
test: /\.(pdf|doc|docx|xls|xlsx|zip|rar)$/,
|
|
320
|
-
};
|
|
321
|
-
},
|
|
322
|
-
};
|
|
323
|
-
return { loaders, rules };
|
|
324
|
-
}
|
|
325
|
-
exports.getFileLoaderUtils = getFileLoaderUtils;
|
|
326
224
|
// Ensure the certificate and key provided are valid and if not
|
|
327
225
|
// throw an easy to debug error
|
|
328
|
-
function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
|
|
226
|
+
function validateKeyAndCerts({ cert, key, keyFile, crtFile, }) {
|
|
329
227
|
let encrypted;
|
|
330
228
|
try {
|
|
331
229
|
// publicEncrypt will throw an error with an invalid cert
|
|
332
230
|
encrypted = crypto_1.default.publicEncrypt(cert, Buffer.from('test'));
|
|
333
231
|
}
|
|
334
232
|
catch (err) {
|
|
335
|
-
throw new Error(`The certificate
|
|
233
|
+
throw new Error(`The certificate ${crtFile} is invalid.
|
|
234
|
+
${err}`);
|
|
336
235
|
}
|
|
337
236
|
try {
|
|
338
237
|
// privateDecrypt will throw an error with an invalid key
|
|
339
238
|
crypto_1.default.privateDecrypt(key, encrypted);
|
|
340
239
|
}
|
|
341
240
|
catch (err) {
|
|
342
|
-
throw new Error(`The certificate key
|
|
241
|
+
throw new Error(`The certificate key ${keyFile} is invalid.
|
|
242
|
+
${err}`);
|
|
343
243
|
}
|
|
344
244
|
}
|
|
345
245
|
// Read file and throw an error if it doesn't exist
|
|
346
246
|
function readEnvFile(file, type) {
|
|
347
247
|
if (!fs_extra_1.default.existsSync(file)) {
|
|
348
|
-
throw new Error(`You specified ${
|
|
248
|
+
throw new Error(`You specified ${type} in your env, but the file "${file}" can't be found.`);
|
|
349
249
|
}
|
|
350
250
|
return fs_extra_1.default.readFileSync(file);
|
|
351
251
|
}
|
|
@@ -391,10 +291,11 @@ function getMinimizer(useSimpleCssMinifier = false) {
|
|
|
391
291
|
// into invalid ecma 5 code. This is why the 'compress' and 'output'
|
|
392
292
|
// sections only apply transformations that are ecma 5 safe
|
|
393
293
|
// https://github.com/facebook/create-react-app/pull/4234
|
|
394
|
-
ecma:
|
|
294
|
+
ecma: 2020,
|
|
395
295
|
},
|
|
396
296
|
compress: {
|
|
397
297
|
ecma: 5,
|
|
298
|
+
// @ts-expect-error: API change in new version?
|
|
398
299
|
warnings: false,
|
|
399
300
|
},
|
|
400
301
|
mangle: {
|
|
@@ -425,10 +326,12 @@ function getMinimizer(useSimpleCssMinifier = false) {
|
|
|
425
326
|
},
|
|
426
327
|
// CleanCss options
|
|
427
328
|
{
|
|
329
|
+
// @ts-expect-error: API change in new version?
|
|
428
330
|
inline: false,
|
|
429
331
|
level: {
|
|
430
332
|
1: {
|
|
431
333
|
all: false,
|
|
334
|
+
removeWhitespace: true,
|
|
432
335
|
},
|
|
433
336
|
2: {
|
|
434
337
|
all: true,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/core",
|
|
3
3
|
"description": "Easy to Maintain Open Source Documentation Websites",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -30,98 +30,103 @@
|
|
|
30
30
|
"bugs": {
|
|
31
31
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
32
32
|
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@docusaurus/module-type-aliases": "2.0.0-beta.12faed89d",
|
|
35
|
-
"@types/detect-port": "^1.3.0",
|
|
36
|
-
"@types/nprogress": "^0.2.0",
|
|
37
|
-
"tmp-promise": "^3.0.2"
|
|
38
|
-
},
|
|
39
33
|
"dependencies": {
|
|
40
|
-
"@babel/core": "^7.
|
|
41
|
-
"@babel/generator": "^7.
|
|
34
|
+
"@babel/core": "^7.16.0",
|
|
35
|
+
"@babel/generator": "^7.16.0",
|
|
42
36
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
43
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
44
|
-
"@babel/preset-env": "^7.
|
|
45
|
-
"@babel/preset-react": "^7.
|
|
46
|
-
"@babel/preset-typescript": "^7.
|
|
47
|
-
"@babel/runtime": "^7.
|
|
48
|
-
"@babel/runtime-corejs3": "^7.
|
|
49
|
-
"@babel/traverse": "^7.
|
|
50
|
-
"@docusaurus/cssnano-preset": "2.0.0-beta.
|
|
51
|
-
"@docusaurus/
|
|
52
|
-
"@docusaurus/
|
|
53
|
-
"@docusaurus/
|
|
54
|
-
"@docusaurus/utils
|
|
55
|
-
"@docusaurus/utils-
|
|
37
|
+
"@babel/plugin-transform-runtime": "^7.16.0",
|
|
38
|
+
"@babel/preset-env": "^7.16.4",
|
|
39
|
+
"@babel/preset-react": "^7.16.0",
|
|
40
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
41
|
+
"@babel/runtime": "^7.16.3",
|
|
42
|
+
"@babel/runtime-corejs3": "^7.16.3",
|
|
43
|
+
"@babel/traverse": "^7.16.3",
|
|
44
|
+
"@docusaurus/cssnano-preset": "2.0.0-beta.14",
|
|
45
|
+
"@docusaurus/logger": "2.0.0-beta.14",
|
|
46
|
+
"@docusaurus/mdx-loader": "2.0.0-beta.14",
|
|
47
|
+
"@docusaurus/react-loadable": "5.5.2",
|
|
48
|
+
"@docusaurus/utils": "2.0.0-beta.14",
|
|
49
|
+
"@docusaurus/utils-common": "2.0.0-beta.14",
|
|
50
|
+
"@docusaurus/utils-validation": "2.0.0-beta.14",
|
|
56
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
|
|
57
|
-
"@svgr/webpack": "^
|
|
58
|
-
"autoprefixer": "^10.
|
|
52
|
+
"@svgr/webpack": "^6.0.0",
|
|
53
|
+
"autoprefixer": "^10.3.5",
|
|
59
54
|
"babel-loader": "^8.2.2",
|
|
60
55
|
"babel-plugin-dynamic-import-node": "2.3.0",
|
|
61
56
|
"boxen": "^5.0.1",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"clean-css": "^5.1.2",
|
|
57
|
+
"chokidar": "^3.5.2",
|
|
58
|
+
"clean-css": "^5.1.5",
|
|
65
59
|
"commander": "^5.1.0",
|
|
66
|
-
"copy-webpack-plugin": "^9.0.
|
|
67
|
-
"core-js": "^3.
|
|
60
|
+
"copy-webpack-plugin": "^9.0.1",
|
|
61
|
+
"core-js": "^3.18.0",
|
|
68
62
|
"css-loader": "^5.1.1",
|
|
69
|
-
"css-minimizer-webpack-plugin": "^3.0.
|
|
70
|
-
"cssnano": "^5.0.
|
|
63
|
+
"css-minimizer-webpack-plugin": "^3.0.2",
|
|
64
|
+
"cssnano": "^5.0.8",
|
|
71
65
|
"del": "^6.0.0",
|
|
72
66
|
"detect-port": "^1.3.0",
|
|
73
67
|
"escape-html": "^1.0.3",
|
|
74
|
-
"eta": "^1.12.
|
|
75
|
-
"express": "^4.17.1",
|
|
68
|
+
"eta": "^1.12.3",
|
|
76
69
|
"file-loader": "^6.2.0",
|
|
77
70
|
"fs-extra": "^10.0.0",
|
|
78
|
-
"github-slugger": "^1.3.0",
|
|
79
71
|
"globby": "^11.0.2",
|
|
80
|
-
"html-minifier-terser": "^
|
|
72
|
+
"html-minifier-terser": "^6.0.2",
|
|
81
73
|
"html-tags": "^3.1.0",
|
|
82
|
-
"html-webpack-plugin": "^5.
|
|
74
|
+
"html-webpack-plugin": "^5.4.0",
|
|
83
75
|
"import-fresh": "^3.3.0",
|
|
84
76
|
"is-root": "^2.1.0",
|
|
85
77
|
"leven": "^3.1.0",
|
|
86
78
|
"lodash": "^4.17.20",
|
|
87
79
|
"mini-css-extract-plugin": "^1.6.0",
|
|
88
|
-
"module-alias": "^2.2.2",
|
|
89
80
|
"nprogress": "^0.2.0",
|
|
90
|
-
"postcss": "^8.
|
|
91
|
-
"postcss-loader": "^
|
|
81
|
+
"postcss": "^8.3.7",
|
|
82
|
+
"postcss-loader": "^6.1.1",
|
|
92
83
|
"prompts": "^2.4.1",
|
|
93
|
-
"react-dev-utils": "
|
|
84
|
+
"react-dev-utils": "12.0.0-next.47",
|
|
94
85
|
"react-error-overlay": "^6.0.9",
|
|
95
86
|
"react-helmet": "^6.1.0",
|
|
96
|
-
"react-loadable": "
|
|
87
|
+
"react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
|
|
97
88
|
"react-loadable-ssr-addon-v5-slorber": "^1.0.1",
|
|
98
89
|
"react-router": "^5.2.0",
|
|
99
90
|
"react-router-config": "^5.1.1",
|
|
100
91
|
"react-router-dom": "^5.2.0",
|
|
92
|
+
"remark-admonitions": "^1.2.1",
|
|
101
93
|
"resolve-pathname": "^3.0.0",
|
|
102
|
-
"rtl-detect": "^1.0.
|
|
94
|
+
"rtl-detect": "^1.0.4",
|
|
103
95
|
"semver": "^7.3.4",
|
|
104
96
|
"serve-handler": "^6.1.3",
|
|
105
97
|
"shelljs": "^0.8.4",
|
|
106
|
-
"std-env": "^2.2.1",
|
|
107
98
|
"strip-ansi": "^6.0.0",
|
|
108
|
-
"terser-webpack-plugin": "^5.
|
|
109
|
-
"tslib": "^2.
|
|
99
|
+
"terser-webpack-plugin": "^5.2.4",
|
|
100
|
+
"tslib": "^2.3.1",
|
|
110
101
|
"update-notifier": "^5.1.0",
|
|
111
102
|
"url-loader": "^4.1.1",
|
|
112
|
-
"wait-on": "^
|
|
113
|
-
"webpack": "^5.
|
|
103
|
+
"wait-on": "^6.0.0",
|
|
104
|
+
"webpack": "^5.61.0",
|
|
114
105
|
"webpack-bundle-analyzer": "^4.4.2",
|
|
115
|
-
"webpack-dev-server": "^
|
|
106
|
+
"webpack-dev-server": "^4.5.0",
|
|
116
107
|
"webpack-merge": "^5.8.0",
|
|
117
108
|
"webpackbar": "^5.0.0-3"
|
|
118
109
|
},
|
|
110
|
+
"devDependencies": {
|
|
111
|
+
"@docusaurus/module-type-aliases": "2.0.0-beta.14",
|
|
112
|
+
"@docusaurus/types": "2.0.0-beta.14",
|
|
113
|
+
"@types/copy-webpack-plugin": "^8.0.1",
|
|
114
|
+
"@types/css-minimizer-webpack-plugin": "^3.0.2",
|
|
115
|
+
"@types/detect-port": "^1.3.0",
|
|
116
|
+
"@types/mini-css-extract-plugin": "^1.4.3",
|
|
117
|
+
"@types/nprogress": "^0.2.0",
|
|
118
|
+
"@types/react-dom": "^17.0.9",
|
|
119
|
+
"@types/rtl-detect": "^1.0.0",
|
|
120
|
+
"@types/serve-handler": "^6.1.1",
|
|
121
|
+
"@types/webpack-bundle-analyzer": "^4.4.1",
|
|
122
|
+
"tmp-promise": "^3.0.2"
|
|
123
|
+
},
|
|
119
124
|
"peerDependencies": {
|
|
120
125
|
"react": "^16.8.4 || ^17.0.0",
|
|
121
126
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
122
127
|
},
|
|
123
128
|
"engines": {
|
|
124
|
-
"node": ">=
|
|
129
|
+
"node": ">=14"
|
|
125
130
|
},
|
|
126
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "c4824a8937d8f1aa0806667749cbc74058e2b294"
|
|
127
132
|
}
|