Skip to content

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

View your CI Pipeline Execution ↗ for commit c1d198a.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 2m 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-18 11:02:33 UTC

yannbf pushed a commit that referenced this pull request Apr 17, 2025
…-hooks-in-stories

Disable rule of hooks in stories files
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