mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 15:07:17 +02:00
fix(v2): revert webpack.resolve.symlinks = false (#5164)
* WathcOptions should work even if Webpack does not resolve symlinks * re-enable webpack resolve.symlinks = true * Use symlinked folder as source
This commit is contained in:
parent
f33cd079c2
commit
d3764f77fe
3 changed files with 10 additions and 4 deletions
|
@ -185,8 +185,12 @@ export default async function start(
|
||||||
},
|
},
|
||||||
publicPath: baseUrl,
|
publicPath: baseUrl,
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
ignored: /node_modules/,
|
|
||||||
poll: cliOptions.poll,
|
poll: cliOptions.poll,
|
||||||
|
|
||||||
|
// Useful options for our own monorepo using symlinks!
|
||||||
|
// See https://github.com/webpack/webpack/issues/11612#issuecomment-879259806
|
||||||
|
followSymlinks: true,
|
||||||
|
ignored: /node_modules\/(?!@docusaurus)/,
|
||||||
},
|
},
|
||||||
historyApiFallback: {
|
historyApiFallback: {
|
||||||
rewrites: [{from: /\/*/, to: baseUrl}],
|
rewrites: [{from: /\/*/, to: baseUrl}],
|
||||||
|
|
|
@ -139,7 +139,7 @@ export function createBaseConfig(
|
||||||
resolve: {
|
resolve: {
|
||||||
unsafeCache: false, // not enabled, does not seem to improve perf much
|
unsafeCache: false, // not enabled, does not seem to improve perf much
|
||||||
extensions: ['.wasm', '.mjs', '.js', '.jsx', '.ts', '.tsx', '.json'],
|
extensions: ['.wasm', '.mjs', '.js', '.jsx', '.ts', '.tsx', '.json'],
|
||||||
symlinks: false, // disabled on purpose (https://github.com/facebook/docusaurus/issues/3272)
|
symlinks: true, // see https://github.com/facebook/docusaurus/issues/3272
|
||||||
roots: [
|
roots: [
|
||||||
// Allow resolution of url("/fonts/xyz.ttf") by webpack
|
// Allow resolution of url("/fonts/xyz.ttf") by webpack
|
||||||
// See https://webpack.js.org/configuration/resolve/#resolveroots
|
// See https://webpack.js.org/configuration/resolve/#resolveroots
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const versions = require('./versions.json');
|
const versions = require('./versions.json');
|
||||||
const math = require('remark-math');
|
const math = require('remark-math');
|
||||||
|
@ -121,10 +122,11 @@ const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
|
||||||
{
|
{
|
||||||
// This plugin instance is used to test fancy edge cases
|
// This plugin instance is used to test fancy edge cases
|
||||||
id: 'docs-tests',
|
id: 'docs-tests',
|
||||||
// Using a symlinked folder as source, test against https://github.com/facebook/docusaurus/issues/3272
|
|
||||||
path: 'dogfooding/docs-tests-symlink',
|
|
||||||
routeBasePath: 'docs-tests',
|
routeBasePath: 'docs-tests',
|
||||||
sidebarPath: 'dogfooding/docs-tests-sidebars.js',
|
sidebarPath: 'dogfooding/docs-tests-sidebars.js',
|
||||||
|
|
||||||
|
// Using a symlinked folder as source, test for use-case https://github.com/facebook/docusaurus/issues/3272
|
||||||
|
path: fs.realpathSync('dogfooding/docs-tests-symlink'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue