question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need to restart server after adding new example file

See original GitHub issue

I don’t remember if this is a regression or not, but every time I add a new component I have to restart the server. Hot reloading works when I make changes to the component and the md file, but new files don’t get picked up.

Here is my config:

const path = require('path')

// Exit on end of STDIN
process.stdin.resume()
process.stdin.on('end', () => process.exit(0))

module.exports = {
  title: 'My Style Guide',
  sections: [
    {
      name: 'Forms',
      components: './client/app/components/forms/**/*.js',
    },
  ],
  skipComponentsWithoutExample: true,

  getExampleFilename(componentPath) {
    return componentPath.replace(/\.js$/, '.examples.md')
  },

  getComponentPathLine(componentPath) {
    const name = path.basename(componentPath, '.js')
    const dir = path.dirname(componentPath.replace(/^client\/app/, ''))

    return `import ${name} from 'app${dir}/${name}'`
  },

  updateWebpackConfig(webpackConfig) {
    // Your source files folder or array of folders, should not include node_modules
    const clientDir = path.join(__dirname, 'client')
    webpackConfig.resolve.modules.unshift(clientDir)
    webpackConfig.module.loaders.push(
      // Babel loader will use your project’s .babelrc
      {
        test: /\.jsx?$/,
        include: clientDir,
        loader: 'babel',
      },
      {
        test: /\.css$/,
        include: [
          path.dirname(require.resolve('ress')),
          clientDir,
        ],
        loaders: [
          'style',
          'css',
        ],
      }
    )

    return webpackConfig
  },
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
aaronjensencommented, Jan 25, 2017

Yes, it’s working for me.

1reaction
sapegincommented, Sep 17, 2016

@tizmagik But that will require page reload in a browser?

Read more comments on GitHub >

github_iconTop Results From Across the Web

node - restart server after editing specific files - Stack Overflow
Use supervisor. Install it with npm install supervisor -g and launch your code with supervisor server.js and you should be good to go....
Read more >
can we update the property file with out restarting the server
i have a scenario that i want to update the property file of an applicaton which is running in mmc ,from the another...
Read more >
Do I need to restart my server after editing fstab and mtab?
To answer the question on rebooting: No, there is no need to reboot after ... its content will change after, say, a reboot,...
Read more >
When the test server requires restarting - IBM
When an application is running on a server and you change the code, the Java™ virtual machine keeps running the initial code until...
Read more >
How to correctly reset, restart, and recycle IIS websites
How and WHEN to restart and recycle your IIS website for maximum availability. ... You want to make sure that the web server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found