@docusaurus/core 0.0.0-4205 → 0.0.0-4209
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/lib/.tsbuildinfo +1 -1
- package/lib/choosePort.js +2 -2
- package/lib/client/.tsbuildinfo +1 -1
- package/lib/client/LinksCollector.d.ts +2 -2
- package/lib/client/LinksCollector.js +4 -8
- package/lib/client/docusaurus.js +6 -8
- package/lib/client/exports/Interpolate.js +7 -14
- package/lib/client/exports/useBaseUrl.js +1 -3
- package/lib/client/serverEntry.js +4 -4
- 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 +11 -17
- package/lib/commands/start.js +3 -4
- package/lib/server/brokenLinks.js +2 -6
- package/lib/server/configValidation.d.ts +1 -1
- package/lib/server/configValidation.js +6 -2
- package/lib/server/i18n.js +1 -5
- package/lib/server/index.js +4 -3
- package/lib/server/plugins/index.js +4 -6
- package/lib/server/themes/alias.js +1 -3
- package/lib/server/translations/translations.js +3 -5
- package/lib/server/translations/translationsExtractor.js +1 -3
- package/lib/webpack/plugins/CleanWebpackPlugin.js +2 -6
- package/lib/webpack/utils.js +57 -71
- package/package.json +8 -8
package/lib/commands/start.js
CHANGED
|
@@ -20,7 +20,6 @@ const webpack_1 = (0, tslib_1.__importDefault)(require("webpack"));
|
|
|
20
20
|
const webpack_dev_server_1 = (0, tslib_1.__importDefault)(require("webpack-dev-server"));
|
|
21
21
|
const webpack_merge_1 = (0, tslib_1.__importDefault)(require("webpack-merge"));
|
|
22
22
|
const server_1 = require("../server");
|
|
23
|
-
const constants_1 = require("../constants");
|
|
24
23
|
const client_1 = (0, tslib_1.__importDefault)(require("../webpack/client"));
|
|
25
24
|
const utils_2 = require("../webpack/utils");
|
|
26
25
|
const commandUtils_1 = require("./commandUtils");
|
|
@@ -144,9 +143,9 @@ async function start(siteDir, cliOptions) {
|
|
|
144
143
|
// Reduce log verbosity, see https://github.com/facebook/docusaurus/pull/5420#issuecomment-906613105
|
|
145
144
|
stats: 'summary',
|
|
146
145
|
},
|
|
147
|
-
static: {
|
|
146
|
+
static: siteConfig.staticDirectories.map((dir) => ({
|
|
148
147
|
publicPath: baseUrl,
|
|
149
|
-
directory: path_1.default.resolve(siteDir,
|
|
148
|
+
directory: path_1.default.resolve(siteDir, dir),
|
|
150
149
|
watch: {
|
|
151
150
|
// Useful options for our own monorepo using symlinks!
|
|
152
151
|
// See https://github.com/webpack/webpack/issues/11612#issuecomment-879259806
|
|
@@ -154,7 +153,7 @@ async function start(siteDir, cliOptions) {
|
|
|
154
153
|
ignored: /node_modules\/(?!@docusaurus)/,
|
|
155
154
|
...{ pollingOptions },
|
|
156
155
|
},
|
|
157
|
-
},
|
|
156
|
+
})),
|
|
158
157
|
historyApiFallback: {
|
|
159
158
|
rewrites: [{ from: /\/*/, to: baseUrl }],
|
|
160
159
|
},
|
|
@@ -50,9 +50,7 @@ function filterIntermediateRoutes(routesInput) {
|
|
|
50
50
|
}
|
|
51
51
|
function getAllBrokenLinks({ allCollectedLinks, routes, }) {
|
|
52
52
|
const filteredRoutes = filterIntermediateRoutes(routes);
|
|
53
|
-
const allBrokenLinks = (0, lodash_1.mapValues)(allCollectedLinks, (pageLinks, pagePath) => {
|
|
54
|
-
return getPageBrokenLinks({ pageLinks, pagePath, routes: filteredRoutes });
|
|
55
|
-
});
|
|
53
|
+
const allBrokenLinks = (0, lodash_1.mapValues)(allCollectedLinks, (pageLinks, pagePath) => getPageBrokenLinks({ pageLinks, pagePath, routes: filteredRoutes }));
|
|
56
54
|
// remove pages without any broken link
|
|
57
55
|
return (0, lodash_1.pickBy)(allBrokenLinks, (brokenLinks) => brokenLinks.length > 0);
|
|
58
56
|
}
|
|
@@ -117,9 +115,7 @@ async function filterExistingFileLinks({ baseUrl, outDir, allCollectedLinks, })
|
|
|
117
115
|
}
|
|
118
116
|
return filePathsToTry.some(isExistingFile);
|
|
119
117
|
}
|
|
120
|
-
return (0, lodash_1.mapValues)(allCollectedLinks, (links) =>
|
|
121
|
-
return links.filter((link) => !linkFileExists(link));
|
|
122
|
-
});
|
|
118
|
+
return (0, lodash_1.mapValues)(allCollectedLinks, (links) => links.filter((link) => !linkFileExists(link)));
|
|
123
119
|
}
|
|
124
120
|
exports.filterExistingFileLinks = filterExistingFileLinks;
|
|
125
121
|
async function handleBrokenLinks({ allCollectedLinks, onBrokenLinks, routes, baseUrl, outDir, }) {
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
import { DocusaurusConfig, I18nConfig } from '@docusaurus/types';
|
|
8
8
|
import { Joi } from '@docusaurus/utils-validation';
|
|
9
9
|
export declare const DEFAULT_I18N_CONFIG: I18nConfig;
|
|
10
|
-
export declare const DEFAULT_CONFIG: Pick<DocusaurusConfig, 'i18n' | 'onBrokenLinks' | 'onBrokenMarkdownLinks' | 'onDuplicateRoutes' | 'plugins' | 'themes' | 'presets' | 'customFields' | 'themeConfig' | 'titleDelimiter' | 'noIndex' | 'baseUrlIssueBanner'>;
|
|
10
|
+
export declare const DEFAULT_CONFIG: Pick<DocusaurusConfig, 'i18n' | 'onBrokenLinks' | 'onBrokenMarkdownLinks' | 'onDuplicateRoutes' | 'plugins' | 'themes' | 'presets' | 'customFields' | 'themeConfig' | 'titleDelimiter' | 'noIndex' | 'baseUrlIssueBanner' | 'staticDirectories'>;
|
|
11
11
|
export declare const ConfigSchema: Joi.ObjectSchema<any>;
|
|
12
12
|
export declare function validateConfig(config: Partial<DocusaurusConfig>): DocusaurusConfig;
|
|
@@ -28,6 +28,7 @@ exports.DEFAULT_CONFIG = {
|
|
|
28
28
|
titleDelimiter: '|',
|
|
29
29
|
noIndex: false,
|
|
30
30
|
baseUrlIssueBanner: true,
|
|
31
|
+
staticDirectories: [constants_1.STATIC_DIR_NAME],
|
|
31
32
|
};
|
|
32
33
|
const PluginSchema = utils_validation_1.Joi.alternatives()
|
|
33
34
|
.try(utils_validation_1.Joi.function(), utils_validation_1.Joi.array().ordered(utils_validation_1.Joi.function().required(), utils_validation_1.Joi.object().required()), utils_validation_1.Joi.string(), utils_validation_1.Joi.array()
|
|
@@ -68,7 +69,7 @@ const I18N_CONFIG_SCHEMA = utils_validation_1.Joi.object({
|
|
|
68
69
|
})
|
|
69
70
|
.optional()
|
|
70
71
|
.default(exports.DEFAULT_I18N_CONFIG);
|
|
71
|
-
const SiteUrlSchema = utils_validation_1.URISchema.required().custom(
|
|
72
|
+
const SiteUrlSchema = utils_validation_1.URISchema.required().custom((value, helpers) => {
|
|
72
73
|
try {
|
|
73
74
|
const { pathname } = new URL(value);
|
|
74
75
|
if (pathname !== '/') {
|
|
@@ -84,7 +85,7 @@ const SiteUrlSchema = utils_validation_1.URISchema.required().custom(function (v
|
|
|
84
85
|
exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
85
86
|
baseUrl: utils_validation_1.Joi.string()
|
|
86
87
|
.required()
|
|
87
|
-
.regex(
|
|
88
|
+
.regex(/\/$/m)
|
|
88
89
|
.message('{{#label}} must be a string with a trailing slash.'),
|
|
89
90
|
baseUrlIssueBanner: utils_validation_1.Joi.boolean().default(exports.DEFAULT_CONFIG.baseUrlIssueBanner),
|
|
90
91
|
favicon: utils_validation_1.Joi.string().optional(),
|
|
@@ -102,6 +103,9 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
102
103
|
.equal('ignore', 'log', 'warn', 'error', 'throw')
|
|
103
104
|
.default(exports.DEFAULT_CONFIG.onDuplicateRoutes),
|
|
104
105
|
organizationName: utils_validation_1.Joi.string().allow(''),
|
|
106
|
+
staticDirectories: utils_validation_1.Joi.array()
|
|
107
|
+
.items(utils_validation_1.Joi.string())
|
|
108
|
+
.default(exports.DEFAULT_CONFIG.staticDirectories),
|
|
105
109
|
projectName: utils_validation_1.Joi.string().allow(''),
|
|
106
110
|
deploymentBranch: utils_validation_1.Joi.string().optional(),
|
|
107
111
|
customFields: utils_validation_1.Joi.object().unknown().default(exports.DEFAULT_CONFIG.customFields),
|
package/lib/server/i18n.js
CHANGED
|
@@ -10,9 +10,7 @@ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
|
10
10
|
function getDefaultLocaleLabel(locale) {
|
|
11
11
|
// Intl.DisplayNames is ES2021 - Node14+
|
|
12
12
|
// https://v8.dev/features/intl-displaynames
|
|
13
|
-
// @ts-expect-error: wait for TS support of ES2021 feature
|
|
14
13
|
if (typeof Intl.DisplayNames !== 'undefined') {
|
|
15
|
-
// @ts-expect-error: wait for TS support of ES2021 feature
|
|
16
14
|
return new Intl.DisplayNames([locale], { type: 'language' }).of(locale);
|
|
17
15
|
}
|
|
18
16
|
return locale;
|
|
@@ -50,9 +48,7 @@ Note: Docusaurus only support running one locale at a time.`));
|
|
|
50
48
|
...i18nConfig.localeConfigs[locale],
|
|
51
49
|
};
|
|
52
50
|
}
|
|
53
|
-
const localeConfigs = locales.reduce((acc, locale) => {
|
|
54
|
-
return { ...acc, [locale]: getLocaleConfig(locale) };
|
|
55
|
-
}, {});
|
|
51
|
+
const localeConfigs = locales.reduce((acc, locale) => ({ ...acc, [locale]: getLocaleConfig(locale) }), {});
|
|
56
52
|
return {
|
|
57
53
|
defaultLocale: i18nConfig.defaultLocale,
|
|
58
54
|
locales,
|
package/lib/server/index.js
CHANGED
|
@@ -134,7 +134,7 @@ function createBootstrapPlugin({ siteConfig, }) {
|
|
|
134
134
|
// Adds a "fallback" mdx loader for mdx files that are not processed by content plugins
|
|
135
135
|
// This allows to do things such as importing repo/README.md as a partial from another doc
|
|
136
136
|
// Not ideal solution though, but good enough for now
|
|
137
|
-
function createMDXFallbackPlugin({ siteDir }) {
|
|
137
|
+
function createMDXFallbackPlugin({ siteDir, siteConfig, }) {
|
|
138
138
|
return {
|
|
139
139
|
name: 'docusaurus-mdx-fallback-plugin',
|
|
140
140
|
content: null,
|
|
@@ -163,7 +163,8 @@ function createMDXFallbackPlugin({ siteDir }) {
|
|
|
163
163
|
{
|
|
164
164
|
loader: require.resolve('@docusaurus/mdx-loader'),
|
|
165
165
|
options: {
|
|
166
|
-
|
|
166
|
+
staticDirs: siteConfig.staticDirectories.map((dir) => path_1.default.resolve(siteDir, dir)),
|
|
167
|
+
siteDir,
|
|
167
168
|
isMDXPartial: (_filename) => true,
|
|
168
169
|
isMDXPartialFrontMatterWarningDisabled: true,
|
|
169
170
|
remarkPlugins: [remark_admonitions_1.default],
|
|
@@ -191,7 +192,7 @@ async function load(siteDir, options = {}) {
|
|
|
191
192
|
// We want the generated config to have been normalized by the plugins!
|
|
192
193
|
const genSiteConfig = (0, utils_1.generate)(generatedFilesDir, constants_1.DEFAULT_CONFIG_FILE_NAME, `export default ${JSON.stringify(siteConfig, null, 2)};`);
|
|
193
194
|
plugins.push(createBootstrapPlugin({ siteConfig }));
|
|
194
|
-
plugins.push(createMDXFallbackPlugin({ siteDir }));
|
|
195
|
+
plugins.push(createMDXFallbackPlugin({ siteDir, siteConfig }));
|
|
195
196
|
// Load client modules.
|
|
196
197
|
const clientModules = (0, client_modules_1.default)(plugins);
|
|
197
198
|
const genClientModules = (0, utils_1.generate)(generatedFilesDir, 'client-modules.js', `export default [\n${clientModules
|
|
@@ -83,12 +83,10 @@ async function loadPlugins({ pluginConfigs, context, }) {
|
|
|
83
83
|
}));
|
|
84
84
|
const allContent = (0, lodash_1.chain)(loadedPlugins)
|
|
85
85
|
.groupBy((item) => item.name)
|
|
86
|
-
.mapValues((nameItems) =>
|
|
87
|
-
return (0
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.value();
|
|
91
|
-
})
|
|
86
|
+
.mapValues((nameItems) => (0, lodash_1.chain)(nameItems)
|
|
87
|
+
.groupBy((item) => { var _a; return (_a = item.options.id) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_PLUGIN_ID; })
|
|
88
|
+
.mapValues((idItems) => idItems[0].content)
|
|
89
|
+
.value())
|
|
92
90
|
.value();
|
|
93
91
|
// 3. Plugin Lifecycle - contentLoaded.
|
|
94
92
|
const pluginsRouteConfigs = [];
|
|
@@ -20,9 +20,7 @@ function sortAliases(aliases) {
|
|
|
20
20
|
// Alphabetical order by default
|
|
21
21
|
const entries = (0, lodash_1.sortBy)(Object.entries(aliases), ([alias]) => alias);
|
|
22
22
|
// @theme/NavbarItem should be after @theme/NavbarItem/LocaleDropdown
|
|
23
|
-
entries.sort(([alias1], [alias2]) => {
|
|
24
|
-
return alias1.includes(`${alias2}/`) ? -1 : 0;
|
|
25
|
-
});
|
|
23
|
+
entries.sort(([alias1], [alias2]) => alias1.includes(`${alias2}/`) ? -1 : 0);
|
|
26
24
|
return Object.fromEntries(entries);
|
|
27
25
|
}
|
|
28
26
|
exports.sortAliases = sortAliases;
|
|
@@ -172,9 +172,7 @@ async function localizePluginTranslationFile({ siteDir, plugin, locale, translat
|
|
|
172
172
|
exports.localizePluginTranslationFile = localizePluginTranslationFile;
|
|
173
173
|
async function getPluginsDefaultCodeTranslationMessages(plugins) {
|
|
174
174
|
const pluginsMessages = await Promise.all(plugins.map((plugin) => { var _a, _b; return (_b = (_a = plugin.getDefaultCodeTranslationMessages) === null || _a === void 0 ? void 0 : _a.call(plugin)) !== null && _b !== void 0 ? _b : {}; }));
|
|
175
|
-
return pluginsMessages.reduce((allMessages, pluginMessages) => {
|
|
176
|
-
return { ...allMessages, ...pluginMessages };
|
|
177
|
-
}, {});
|
|
175
|
+
return pluginsMessages.reduce((allMessages, pluginMessages) => ({ ...allMessages, ...pluginMessages }), {});
|
|
178
176
|
}
|
|
179
177
|
exports.getPluginsDefaultCodeTranslationMessages = getPluginsDefaultCodeTranslationMessages;
|
|
180
178
|
function applyDefaultCodeTranslations({ extractedCodeTranslations, defaultCodeMessages, }) {
|
|
@@ -187,10 +185,10 @@ Please report this Docusaurus issue.
|
|
|
187
185
|
}
|
|
188
186
|
return (0, lodash_1.mapValues)(extractedCodeTranslations, (messageTranslation, messageId) => {
|
|
189
187
|
var _a;
|
|
190
|
-
return {
|
|
188
|
+
return ({
|
|
191
189
|
...messageTranslation,
|
|
192
190
|
message: (_a = defaultCodeMessages[messageId]) !== null && _a !== void 0 ? _a : messageTranslation.message,
|
|
193
|
-
};
|
|
191
|
+
});
|
|
194
192
|
});
|
|
195
193
|
}
|
|
196
194
|
exports.applyDefaultCodeTranslations = applyDefaultCodeTranslations;
|
|
@@ -63,9 +63,7 @@ async function getSourceCodeFilePaths(siteDir, plugins) {
|
|
|
63
63
|
async function extractSiteSourceCodeTranslations(siteDir, plugins, babelOptions, extraSourceCodeFilePaths = []) {
|
|
64
64
|
// Should we warn here if the same translation "key" is found in multiple source code files?
|
|
65
65
|
function toTranslationFileContent(sourceCodeFileTranslations) {
|
|
66
|
-
return sourceCodeFileTranslations.reduce((acc, item) => {
|
|
67
|
-
return { ...acc, ...item.translations };
|
|
68
|
-
}, {});
|
|
66
|
+
return sourceCodeFileTranslations.reduce((acc, item) => ({ ...acc, ...item.translations }), {});
|
|
69
67
|
}
|
|
70
68
|
const sourceCodeFilePaths = await getSourceCodeFilePaths(siteDir, plugins);
|
|
71
69
|
const allSourceCodeFilePaths = [
|
|
@@ -86,17 +86,13 @@ class CleanWebpackPlugin {
|
|
|
86
86
|
all: false,
|
|
87
87
|
assets: true,
|
|
88
88
|
}).assets || [];
|
|
89
|
-
const assets = statsAssets.map((asset) =>
|
|
90
|
-
return asset.name;
|
|
91
|
-
});
|
|
89
|
+
const assets = statsAssets.map((asset) => asset.name);
|
|
92
90
|
/**
|
|
93
91
|
* Get all files that were in the previous build but not the current
|
|
94
92
|
*
|
|
95
93
|
* (relies on del's cwd: outputPath option)
|
|
96
94
|
*/
|
|
97
|
-
const staleFiles = this.currentAssets.filter((previousAsset) =>
|
|
98
|
-
return assets.includes(previousAsset) === false;
|
|
99
|
-
});
|
|
95
|
+
const staleFiles = this.currentAssets.filter((previousAsset) => assets.includes(previousAsset) === false);
|
|
100
96
|
/**
|
|
101
97
|
* Save assets for next compilation
|
|
102
98
|
*/
|
package/lib/webpack/utils.js
CHANGED
|
@@ -112,7 +112,7 @@ 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 = (0, lodash_1.memoize)(
|
|
115
|
+
const warnBabelLoaderOnce = (0, lodash_1.memoize)(() => {
|
|
116
116
|
console.warn(chalk_1.default.yellow('Docusaurus plans to support multiple JS loader strategies (Babel, esbuild...): "getBabelLoader(isServer)" is now deprecated in favor of "getJSLoader({isServer})".'));
|
|
117
117
|
});
|
|
118
118
|
const getBabelLoaderDeprecated = function getBabelLoaderDeprecated(isServer, babelOptions) {
|
|
@@ -120,7 +120,7 @@ const getBabelLoaderDeprecated = function getBabelLoaderDeprecated(isServer, bab
|
|
|
120
120
|
return getDefaultBabelLoader({ isServer, babelOptions });
|
|
121
121
|
};
|
|
122
122
|
// TODO remove this before end of 2021 ?
|
|
123
|
-
const warnCacheLoaderOnce = (0, lodash_1.memoize)(
|
|
123
|
+
const warnCacheLoaderOnce = (0, lodash_1.memoize)(() => {
|
|
124
124
|
console.warn(chalk_1.default.yellow('Docusaurus uses Webpack 5 and getCacheLoader() usage is now deprecated.'));
|
|
125
125
|
});
|
|
126
126
|
function getCacheLoaderDeprecated() {
|
|
@@ -228,24 +228,20 @@ function getFileLoaderUtils() {
|
|
|
228
228
|
// defines the path/pattern of the assets handled by webpack
|
|
229
229
|
const fileLoaderFileName = (folder) => `${constants_1.OUTPUT_STATIC_ASSETS_DIR_NAME}/${folder}/[name]-[hash].[ext]`;
|
|
230
230
|
const loaders = {
|
|
231
|
-
file: (options) => {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
fallback: require.resolve(`file-loader`),
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
},
|
|
231
|
+
file: (options) => ({
|
|
232
|
+
loader: require.resolve(`file-loader`),
|
|
233
|
+
options: {
|
|
234
|
+
name: fileLoaderFileName(options.folder),
|
|
235
|
+
},
|
|
236
|
+
}),
|
|
237
|
+
url: (options) => ({
|
|
238
|
+
loader: require.resolve(`url-loader`),
|
|
239
|
+
options: {
|
|
240
|
+
limit: urlLoaderLimit,
|
|
241
|
+
name: fileLoaderFileName(options.folder),
|
|
242
|
+
fallback: require.resolve(`file-loader`),
|
|
243
|
+
},
|
|
244
|
+
}),
|
|
249
245
|
// TODO find a better solution to avoid conflicts with the ideal-image plugin
|
|
250
246
|
// TODO this may require a little breaking change for ideal-image users?
|
|
251
247
|
// Maybe with the ideal image plugin, all md images should be "ideal"?
|
|
@@ -259,65 +255,55 @@ function getFileLoaderUtils() {
|
|
|
259
255
|
* Loads image assets, inlines images via a data URI if they are below
|
|
260
256
|
* the size threshold
|
|
261
257
|
*/
|
|
262
|
-
images: () => {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
use: [loaders.url({ folder: 'fonts' })],
|
|
271
|
-
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
272
|
-
};
|
|
273
|
-
},
|
|
258
|
+
images: () => ({
|
|
259
|
+
use: [loaders.url({ folder: 'images' })],
|
|
260
|
+
test: /\.(ico|jpg|jpeg|png|gif|webp)(\?.*)?$/,
|
|
261
|
+
}),
|
|
262
|
+
fonts: () => ({
|
|
263
|
+
use: [loaders.url({ folder: 'fonts' })],
|
|
264
|
+
test: /\.(woff|woff2|eot|ttf|otf)$/,
|
|
265
|
+
}),
|
|
274
266
|
/**
|
|
275
267
|
* Loads audio and video and inlines them via a data URI if they are below
|
|
276
268
|
* the size threshold
|
|
277
269
|
*/
|
|
278
|
-
media: () => {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
svgo: true,
|
|
295
|
-
svgoConfig: {
|
|
296
|
-
plugins: [{ removeViewBox: false }],
|
|
297
|
-
},
|
|
298
|
-
titleProp: true,
|
|
299
|
-
ref: ![path_1.default],
|
|
270
|
+
media: () => ({
|
|
271
|
+
use: [loaders.url({ folder: 'medias' })],
|
|
272
|
+
test: /\.(mp4|webm|ogv|wav|mp3|m4a|aac|oga|flac)$/,
|
|
273
|
+
}),
|
|
274
|
+
svg: () => ({
|
|
275
|
+
test: /\.svg?$/,
|
|
276
|
+
oneOf: [
|
|
277
|
+
{
|
|
278
|
+
use: [
|
|
279
|
+
{
|
|
280
|
+
loader: '@svgr/webpack',
|
|
281
|
+
options: {
|
|
282
|
+
prettier: false,
|
|
283
|
+
svgo: true,
|
|
284
|
+
svgoConfig: {
|
|
285
|
+
plugins: [{ removeViewBox: false }],
|
|
300
286
|
},
|
|
287
|
+
titleProp: true,
|
|
288
|
+
ref: ![path_1.default],
|
|
301
289
|
},
|
|
302
|
-
],
|
|
303
|
-
// We don't want to use SVGR loader for non-React source code
|
|
304
|
-
// ie we don't want to use SVGR for CSS files...
|
|
305
|
-
issuer: {
|
|
306
|
-
and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
|
|
307
290
|
},
|
|
291
|
+
],
|
|
292
|
+
// We don't want to use SVGR loader for non-React source code
|
|
293
|
+
// ie we don't want to use SVGR for CSS files...
|
|
294
|
+
issuer: {
|
|
295
|
+
and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
|
|
308
296
|
},
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
otherAssets: () => {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
};
|
|
320
|
-
},
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
use: [loaders.url({ folder: 'images' })],
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
}),
|
|
303
|
+
otherAssets: () => ({
|
|
304
|
+
use: [loaders.file({ folder: 'files' })],
|
|
305
|
+
test: /\.(pdf|doc|docx|xls|xlsx|zip|rar)$/,
|
|
306
|
+
}),
|
|
321
307
|
};
|
|
322
308
|
return { loaders, rules };
|
|
323
309
|
}
|
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": "0.0.0-
|
|
4
|
+
"version": "0.0.0-4209",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
34
|
+
"@docusaurus/module-type-aliases": "0.0.0-4209",
|
|
35
35
|
"@types/copy-webpack-plugin": "^8.0.1",
|
|
36
36
|
"@types/css-minimizer-webpack-plugin": "^3.0.2",
|
|
37
37
|
"@types/detect-port": "^1.3.0",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"@babel/runtime": "^7.15.4",
|
|
55
55
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
56
56
|
"@babel/traverse": "^7.12.13",
|
|
57
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
57
|
+
"@docusaurus/cssnano-preset": "0.0.0-4209",
|
|
58
58
|
"@docusaurus/react-loadable": "5.5.2",
|
|
59
|
-
"@docusaurus/types": "0.0.0-
|
|
60
|
-
"@docusaurus/utils": "0.0.0-
|
|
61
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
62
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
59
|
+
"@docusaurus/types": "0.0.0-4209",
|
|
60
|
+
"@docusaurus/utils": "0.0.0-4209",
|
|
61
|
+
"@docusaurus/utils-common": "0.0.0-4209",
|
|
62
|
+
"@docusaurus/utils-validation": "0.0.0-4209",
|
|
63
63
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
|
|
64
64
|
"@svgr/webpack": "^5.5.0",
|
|
65
65
|
"autoprefixer": "^10.3.5",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"engines": {
|
|
130
130
|
"node": ">=14"
|
|
131
131
|
},
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "84fd42287ef7e3dc0f0a83ad9e2709e59c15e11b"
|
|
133
133
|
}
|