mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 23:11:23 +08:00
Addon-docs: manager/preview addon refactor
This commit is contained in:
parent
14e3d8516a
commit
b94875522b
1
addons/docs/manager.js
Normal file
1
addons/docs/manager.js
Normal file
@ -0,0 +1 @@
|
||||
import './dist/esm/manager';
|
@ -1,16 +1 @@
|
||||
const { findDistEsm } = require('@storybook/core-common');
|
||||
const { webpack } = require('./dist/cjs/frameworks/common/preset');
|
||||
|
||||
function managerEntries(entry = [], options) {
|
||||
return [...entry, findDistEsm(__dirname, 'manager')];
|
||||
}
|
||||
|
||||
function config(entry = [], options = {}) {
|
||||
return [findDistEsm(__dirname, 'frameworks/common/config'), ...entry];
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
webpack,
|
||||
managerEntries,
|
||||
config,
|
||||
};
|
||||
module.exports = require('./dist/cjs/preset');
|
||||
|
1
addons/docs/preview.js
Normal file
1
addons/docs/preview.js
Normal file
@ -0,0 +1 @@
|
||||
export * from './dist/esm/preview';
|
@ -1,2 +1,6 @@
|
||||
/* eslint-disable import/extensions */
|
||||
require('./dist/esm/manager.js');
|
||||
import { once } from '@storybook/client-logger';
|
||||
import './manager';
|
||||
|
||||
once.warn(
|
||||
'register.js is deprecated see https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-registerjs'
|
||||
);
|
||||
|
@ -1,8 +0,0 @@
|
||||
export const parameters = {
|
||||
docs: {
|
||||
inlineStories: false,
|
||||
getContainer: async () => (await import('../../blocks')).DocsContainer,
|
||||
getPage: async () => (await import('../../blocks')).DocsPage,
|
||||
iframeHeight: 100,
|
||||
},
|
||||
};
|
8
addons/docs/src/preview.ts
Normal file
8
addons/docs/src/preview.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export const parameters = {
|
||||
docs: {
|
||||
inlineStories: false,
|
||||
getContainer: async () => (await import('./blocks')).DocsContainer,
|
||||
getPage: async () => (await import('./blocks')).DocsPage,
|
||||
iframeHeight: 100,
|
||||
},
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user