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

Addon-docs: Fix babel-loader resolution based on builder #16752

Merged
merged 4 commits into from
Jan 7, 2022

Conversation

ndelangen
Copy link
Member

Issue: #15336

What I did

resolve the core field via preset.apply
read used builder so we resolve the proper version of babel-loader

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

@nx-cloud
Copy link

nx-cloud bot commented Nov 22, 2021

☁️ Nx Cloud Report

CI ran the following commands for commit 64cdf45. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@ndelangen ndelangen changed the title FIX #15336 : resolve proper babel-loader based on builder Nov 22, 2021
const { builder = 'webpack4' } = await options.presets.apply('core', {});

const resolvedBabelLoader = require.resolve('babel-loader', {
paths: [require.resolve(`@storybook/builder-${builder}`)], // FIXME!!!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the builder is storybook-builder-vite? Also what about the FIXME?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixme can be removed, it's fixed.

I didn't think of the storybook-builder-vite.

@shilman shilman changed the title FIX #15336 : resolve proper babel-loader based on builder Addon-docs: Fix babel-loader resolution based on builder Dec 6, 2021
@shilman shilman assigned ndelangen and unassigned shilman Jan 3, 2022
@ndelangen ndelangen requested a review from shilman January 5, 2022 13:02
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @ndelangen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants