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

Core: Fix package duplication issues by aliasing all storybook packages #11092

Merged
merged 11 commits into from
Jun 11, 2020
Prev Previous commit
Next Next commit
CLEANUP && FIX main.ts
ndelangen committed Jun 10, 2020
commit 0e21344abe80610c11ecd0aa5f6ddd26b5415a01
8 changes: 6 additions & 2 deletions examples/cra-ts-kitchen-sink/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// @ts-ignore
// eslint-disable-next-line import/no-extraneous-dependencies
import { Configuration } from 'webpack';

const path = require('path');

module.exports = {
@@ -26,10 +28,12 @@ module.exports = {
'@storybook/addon-links',
'@storybook/addon-a11y',
],
webpackFinal: (config) => {
webpackFinal: (config: Configuration) => {
// add monorepo root as a valid directory to import modules from
config.resolve.plugins.forEach((p) => {
// @ts-ignore
if (Array.isArray(p.appSrcs)) {
// @ts-ignore
p.appSrcs.push(path.join(__dirname, '..', '..', '..'));
}
});
1 change: 0 additions & 1 deletion lib/core/src/server/manager/manager-webpack.config.js
Original file line number Diff line number Diff line change
@@ -140,7 +140,6 @@ export default async ({
alias: {
...themingPaths,
...uiPaths,
semver: require.resolve('@storybook/semver'),
},
plugins: [
// Transparently resolve packages via PnP when needed; noop otherwise
1 change: 0 additions & 1 deletion lib/core/src/server/preview/iframe-webpack.config.js
Original file line number Diff line number Diff line change
@@ -181,7 +181,6 @@ export default async ({
alias: {
...themingPaths,
...storybookPaths,
semver: path.dirname(resolveFrom(__dirname, '@storybook/semver/package.json')),
...reactPaths,
},