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

Search for a .babelrc in the storybook config directory first, then the project root #149

Merged
merged 1 commit into from
Apr 26, 2016

Conversation

sethkinast
Copy link
Contributor

Closes #138, #139

const content = fs.readFileSync(babelConfigPath, 'utf-8');
try {
config = cjson.parse(content);
config.babelrc = false;
Copy link
Member

Choose a reason for hiding this comment

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

What's the meaning of this?
Can't we use this for everything since we load and pass the babelrc manually anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you don't specifically set this option (babelrc=false), the babel-loader
will look for a .babelrc at the module root and try to use it anyways,
ignoring options you pass to the loader.

On Tue, Apr 26, 2016 at 2:48 AM, Arunoda Susiripala <
[email protected]> wrote:

In src/server/config.js
#149 (comment)
:

@@ -5,23 +5,36 @@ import cjson from 'cjson';
// avoid ESLint errors
const logger = console;

+// Tries to load a .babelrc and returns the parsed object if successful
+function loadBabelConfig(babelConfigPath) {

  • let config;
  • if (fs.existsSync(babelConfigPath)) {
  • const content = fs.readFileSync(babelConfigPath, 'utf-8');
  • try {
  •  config = cjson.parse(content);
    
  •  config.babelrc = false;
    

What's the meaning of this?
Can't we use this for everything since we load and pass the babelrc
manually anyway.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/kadirahq/react-storybook/pull/149/files/c1d198a96de6c64b3443b5b51e9fa50234cbe4bd#r61057793

Seth Kinast
http://sethkinast.com/

Copy link
Member

Choose a reason for hiding this comment

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

Okay.

@arunoda arunoda merged commit 75fbf63 into storybookjs:master Apr 26, 2016
@arunoda
Copy link
Member

arunoda commented Apr 26, 2016

Thanks.

Copy link

nx-cloud bot commented Nov 27, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c1d198a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

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

Successfully merging this pull request may close these issues.

3 participants