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

setting webpack.extra.entry seems to break hot-reloading #105

Closed
brumm opened this issue May 15, 2016 · 2 comments
Closed

setting webpack.extra.entry seems to break hot-reloading #105

brumm opened this issue May 15, 2016 · 2 comments

Comments

@brumm
Copy link

brumm commented May 15, 2016

I set up a new project today, which involves a somewhat complicated nwb.config.js (pasted in full below).

Unfortunately, I seem to have broken HMR in the process, there's no [HMR] log output in the console, and the app does not react to file changes.

Renaming the renderer folder back to src and removing the option for webpack.extra.entry seems to fix things, but I'd like to be able to rename the src if possible.

const path = require('path');
const webpack = require('webpack');
const package = require('./package.json');
const ComponentResolverPlugin = require('component-resolver-webpack');

const cssConfig = {
  query: {
    modules: true,
    localIdentName: '[local]-[hash:base64:10]'
  }
}

module.exports = {
  type: 'react-app',

  webpack: {
    extra: {
      entry: path.resolve('./renderer/index.js'),
      resolve: {
        root: [path.resolve('./renderer')],
        extensions: ["", ".webpack.js", ".web.js", ".js", ".scss"]
      },
      plugins: [
        new webpack.ResolverPlugin([
          new ComponentResolverPlugin()
        ])
      ],
      output: {
        publicPath: ''
      }
    },
    loaders: {
      'css': cssConfig,
      'sass-css': cssConfig
    },
    plugins: {
      html: {
        template: path.resolve('./renderer/index.html'),
        title: package.name
      }
    }
  },

  babel: {
    stage: 0
  }
}
@insin
Copy link
Owner

insin commented May 30, 2016

There are a number of places where src/ and src/index.js are hardcoded, so just using extra probably isn't enough for now.

Will look into making this properly configurable.

@insin
Copy link
Owner

insin commented Jun 1, 2017

Closing in favour of #115 for tracking making this configurable - thanks for the example real-world config, will come in useful when testing the feature.

@insin insin closed this as completed Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants