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

fix(v2): revert webpack.resolve.symlinks = false #5164

Merged
merged 3 commits into from
Jul 13, 2021
Merged
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
6 changes: 5 additions & 1 deletion packages/docusaurus/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@ export default async function start(
},
publicPath: baseUrl,
watchOptions: {
ignored: /node_modules/,
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: {
rewrites: [{from: /\/*/, to: baseUrl}],
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/src/webpack/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function createBaseConfig(
resolve: {
unsafeCache: false, // not enabled, does not seem to improve perf much
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: [
// Allow resolution of url("/fonts/xyz.ttf") by webpack
// See https://webpack.js.org/configuration/resolve/#resolveroots
Expand Down
6 changes: 4 additions & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

const fs = require('fs');
const path = require('path');
const versions = require('./versions.json');
const math = require('remark-math');
Expand Down Expand Up @@ -121,10 +122,11 @@ const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
{
// This plugin instance is used to test fancy edge cases
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',
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'),
},
],

Expand Down