From fb615576be4171abe8b7f914d1cb226246f86cd7 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 23 Oct 2020 14:46:58 +0800 Subject: [PATCH] Core: Disable Docs DLL by default --- addons/docs/src/frameworks/common/preset.ts | 4 ++-- docs/api/cli-options.md | 6 ++++-- lib/core/src/server/cli/dev.js | 3 ++- lib/core/src/server/cli/prod.js | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/addons/docs/src/frameworks/common/preset.ts b/addons/docs/src/frameworks/common/preset.ts index 69aa62750ffd..051102be087f 100644 --- a/addons/docs/src/frameworks/common/preset.ts +++ b/addons/docs/src/frameworks/common/preset.ts @@ -39,7 +39,7 @@ function createBabelOptions({ babelOptions, mdxBabelOptions, configureJSX }: Bab } export const webpackDlls = (dlls: string[], options: any) => { - return options.dll ? [...dlls, './sb_dll/storybook_docs_dll.js'] : []; + return options.docsDll ? [...dlls, './sb_dll/storybook_docs_dll.js'] : []; }; export function webpack(webpackConfig: any = {}, options: any = {}) { @@ -143,7 +143,7 @@ export function webpack(webpackConfig: any = {}, options: any = {}) { }, }; - if (options.dll) { + if (options.docsDll) { result.plugins.push( new DllReferencePlugin({ context, diff --git a/docs/api/cli-options.md b/docs/api/cli-options.md index fbd8eb979238..f7530c09cf3a 100644 --- a/docs/api/cli-options.md +++ b/docs/api/cli-options.md @@ -27,7 +27,8 @@ Usage: start-storybook [options] | --smoke-test | Exit after successful start | `start-storybook --smoke-test` | | --ci | CI mode (skip interactive prompts, don't open browser) | `start-storybook --ci` | | --quiet | Suppress verbose build output | `start-storybook --quiet` | -| --no-dll | Do not use dll reference | `start-storybook --no-dll` | +| --no-dll | Do not use UI dll reference | `start-storybook --no-dll` | +| --docs-dll | Use the Docs dll reference (legacy) | `start-storybook --docs-dll` | | --debug-webpack | Display final webpack configurations for debugging purposes | `start-storybook --debug-webpack` | | --docs | Starts Storybook in documentation mode. Learn more about it in [here](../writing-docs/build-documentation.md#preview-storybooks-documentation) | `start-storybook --docs` | @@ -47,6 +48,7 @@ Usage: build-storybook [options] | -w, --watch | Enables watch mode | `build-storybook -w` | | --loglevel [level] | Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent] | `build-storybook --loglevel warn` | | --quiet | Suppress verbose build output | `build-storybook --quiet` | -| --no-dll | Do not use dll reference | `build-storybook --no-dll` | +| --no-dll | Do not use UI dll reference | `build-storybook --no-dll` | +| --docs-dll | Use Docs dll reference (legacy) | `build-storybook --docs-dll` | | --debug-webpack | Display final webpack configurations for debugging purposes | `build-storybook --debug-webpack` | | --docs | Builds Storybook in documentation mode. Learn more about it in [here](../writing-docs/build-documentation.md#publish-storybooks-documentation)) | `build-storybook --docs` | diff --git a/lib/core/src/server/cli/dev.js b/lib/core/src/server/cli/dev.js index 224cffc6750b..ad8b73ac5176 100644 --- a/lib/core/src/server/cli/dev.js +++ b/lib/core/src/server/cli/dev.js @@ -33,7 +33,8 @@ async function getCLI(packageJson) { 'Suppress automatic redirects to the release notes after upgrading', true ) - .option('--no-dll', 'Do not use dll reference') + .option('--no-dll', 'Do not use UI dll reference') + .option('--docs-dll', 'Use Docs dll reference (legacy)') .option('--debug-webpack', 'Display final webpack configurations for debugging purposes') .option( '--preview-url [string]', diff --git a/lib/core/src/server/cli/prod.js b/lib/core/src/server/cli/prod.js index 99ad8f81076e..e66d86a1378e 100644 --- a/lib/core/src/server/cli/prod.js +++ b/lib/core/src/server/cli/prod.js @@ -14,7 +14,8 @@ function getCLI(packageJson) { .option('-w, --watch', 'Enable watch mode') .option('--quiet', 'Suppress verbose build output') .option('--loglevel [level]', 'Control level of logging during build') - .option('--no-dll', 'Do not use dll reference') + .option('--no-dll', 'Do not use UI dll reference (legacy)') + .option('--docs-dll', 'Use Docs dll reference') .option('--debug-webpack', 'Display final webpack configurations for debugging purposes') .option( '--preview-url [string]',