From becc38656640e71579b6d6f19ebe93c2c4feab88 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Mon, 4 Apr 2022 17:50:05 +1000 Subject: [PATCH] Update some references to use ESM rather than CJS --- addons/links/react.js | 2 +- app/angular/src/server/framework-preset-angular-cli.test.ts | 4 ++-- .../official-storybook/components/addon-measure/ShadowRoot.js | 4 ++-- .../components/addon-measure/Visualization.js | 4 ++-- lib/components/html.js | 2 +- lib/core/client.js | 2 +- lib/router/utils.js | 2 +- lib/theming/create.js | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/links/react.js b/addons/links/react.js index 835dd0388e29..9afbe5390225 100644 --- a/addons/links/react.js +++ b/addons/links/react.js @@ -1 +1 @@ -module.exports = require('./dist/cjs/react'); +module.exports = require('./dist/esm/react'); diff --git a/app/angular/src/server/framework-preset-angular-cli.test.ts b/app/angular/src/server/framework-preset-angular-cli.test.ts index fa356f688eb4..235ddead5e0a 100644 --- a/app/angular/src/server/framework-preset-angular-cli.test.ts +++ b/app/angular/src/server/framework-preset-angular-cli.test.ts @@ -766,8 +766,8 @@ const newWebpackConfiguration = ( bail: false, devtool: 'cheap-module-source-map', entry: [ - '/Users/joe/storybook/lib/core-server/dist/cjs/globals/polyfills.js', - '/Users/joe/storybook/lib/core-server/dist/cjs/globals/globals.js', + '/Users/joe/storybook/lib/core-server/dist/esm/globals/polyfills.js', + '/Users/joe/storybook/lib/core-server/dist/esm/globals/globals.js', '/Users/joe/storybook/examples/angular-cli/.storybook/storybook-init-framework-entry.js', '/Users/joe/storybook/addons/docs/dist/esm/frameworks/common/config.js-generated-other-entry.js', '/Users/joe/storybook/addons/docs/dist/esm/frameworks/angular/config.js-generated-other-entry.js', diff --git a/examples/official-storybook/components/addon-measure/ShadowRoot.js b/examples/official-storybook/components/addon-measure/ShadowRoot.js index 665257cf6d6d..d0587b88d307 100644 --- a/examples/official-storybook/components/addon-measure/ShadowRoot.js +++ b/examples/official-storybook/components/addon-measure/ShadowRoot.js @@ -1,9 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; // eslint-disable-next-line import/no-extraneous-dependencies -import { drawSelectedElement } from '@storybook/addon-measure/dist/cjs/box-model/visualizer'; +import { drawSelectedElement } from '@storybook/addon-measure/dist/esm/box-model/visualizer'; // eslint-disable-next-line import/no-extraneous-dependencies -import { init, destroy } from '@storybook/addon-measure/dist/cjs/box-model/canvas'; +import { init, destroy } from '@storybook/addon-measure/dist/esm/box-model/canvas'; export const ShadowRoot = ({ label = 'Hello from shadow DOM', drawMode = 'ROOT' }) => { const ref = React.useRef(); diff --git a/examples/official-storybook/components/addon-measure/Visualization.js b/examples/official-storybook/components/addon-measure/Visualization.js index bcd10d6a3d1b..6ae319f75f69 100644 --- a/examples/official-storybook/components/addon-measure/Visualization.js +++ b/examples/official-storybook/components/addon-measure/Visualization.js @@ -1,9 +1,9 @@ import React, { useEffect, useRef } from 'react'; import PropTypes from 'prop-types'; // eslint-disable-next-line import/no-extraneous-dependencies -import { drawSelectedElement } from '@storybook/addon-measure/dist/cjs/box-model/visualizer'; +import { drawSelectedElement } from '@storybook/addon-measure/dist/esm/box-model/visualizer'; // eslint-disable-next-line import/no-extraneous-dependencies -import { init, destroy } from '@storybook/addon-measure/dist/cjs/box-model/canvas'; +import { init, destroy } from '@storybook/addon-measure/dist/esm/box-model/canvas'; export const Visualization = ({ render }) => { const element = useRef(null); diff --git a/lib/components/html.js b/lib/components/html.js index 7a58bc516e1f..ffebae388818 100644 --- a/lib/components/html.js +++ b/lib/components/html.js @@ -1 +1 @@ -module.exports = require('./dist/cjs/html'); +module.exports = require('./dist/esm/html'); diff --git a/lib/core/client.js b/lib/core/client.js index 0cea520ec68b..53f27fe5fbf5 100644 --- a/lib/core/client.js +++ b/lib/core/client.js @@ -1 +1 @@ -module.exports = require('./dist/cjs/index'); +module.exports = require('./dist/esm/index'); diff --git a/lib/router/utils.js b/lib/router/utils.js index 3120589b76e6..c61f0e64bfc0 100644 --- a/lib/router/utils.js +++ b/lib/router/utils.js @@ -1 +1 @@ -module.exports = require('./dist/cjs/utils'); +module.exports = require('./dist/esm/utils'); diff --git a/lib/theming/create.js b/lib/theming/create.js index 69e29d7f01b3..65d2da89a5b2 100644 --- a/lib/theming/create.js +++ b/lib/theming/create.js @@ -1 +1 @@ -module.exports = require('./dist/cjs/create'); +module.exports = require('./dist/esm/create');