Skip to content

Commit

Permalink
fix: esm register.js storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Feb 12, 2020
1 parent ece897d commit a7289e6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16,697 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ module.exports = {
name: path.resolve(path.dirname(require.resolve('@component-controls/storybook')), 'preset.js'),
options: {
legacy: true,
addonPanel: true,
},
},

],
stories: [
'../core/editors/src/**/*.stories.(js|tsx|mdx)',
Expand Down
2 changes: 1 addition & 1 deletion integrations/storybook/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default config({
'./src/config-preview.ts',
'./src/config-props-table.ts',
'./src/config-smart.ts',
'./src/register.tsx',
'./src/manager/register.tsx',
],
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import addons from '@storybook/addons';
import { PropsPanel } from './manager/Panel';
import { ADDON_ID, PANEL_ID, PARAM_KEY } from './shared/shared';
import { PropsPanel } from './Panel';
import { ADDON_ID, PANEL_ID, PARAM_KEY } from '../shared/shared';

addons.register(ADDON_ID, api => {
addons.addPanel(PANEL_ID, {
Expand Down
2 changes: 1 addition & 1 deletion integrations/storybook/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
managerEntries: (entry: any[] = [], options: any = {}) => {
const { addonPanel = true } = options;
if (addonPanel) {
return [...entry, require.resolve('./register')];
return [...entry, require.resolve('./register.esm')];
}
return entry;
},
Expand Down
9 changes: 8 additions & 1 deletion rollup-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,18 @@ const createOutput = (dir = 'dist', defaultOpts) => {
const outputs = [
{
dir,
format: 'esm',
format: 'cjs',
chunkFileNames: filename ? `${filename}.js` : `[name].js`,
entryFileNames: filename ? `${filename}.js` : `[name].js`,
...output,
},
{
dir,
format: 'esm',
chunkFileNames: filename ? `${filename}.esm.js` : `[name].esm.js`,
entryFileNames: filename ? `${filename}.esm.js` : `[name].esm.js`,
...output,
},
];

return {
Expand Down
Loading

0 comments on commit a7289e6

Please sign in to comment.