brunch/brunch

autoRequire doesn't work with 2.10.15

AlexandreBourdeaudhui opened this issue · 6 comments

Actual behavior

With the release 2.10.15, my React App doesn't run. I have a white screen and my JS is still not loading. If i'm adding <script>require('src/index');</script> on my index.HTML, it's okay.

Before the new release, i don't have problem with that config

Environment

  1. Brunch: 2.10.15
  2. Node.js: v9.4.0
  3. NPM: v5.6.0
  4. Operating system: Linux / OSX
  5. Code editor: Atom

package.json contents

brunch config contents

    /*
     * Plugins options
     */
    plugins: {
      uglify: {
        compress: {
          drop_console: true,
          drop_debugger: true,
        },
      },
      autoReload: {
        enabled: true,
      },
    },

    /*
     * Builds
     */
    files: {
      stylesheets: {
        joinTo: 'css/app.css',
        order: {
          before: 'app/styles/reset.styl',
        },
      },
      javascripts: {
        joinTo: 'js/app.js',
      },
    },
    paths: {
      watched: ['app'],
      packageConfig: 'node_modules/config-oclock-front/package.json',
    },
    modules: {
      autoRequire: {
        'js/app.js': ['src/index'],
      },
    },
  };

I can confirm, lost quite some time on it. The compiled file doesn't contain the "requires" at the end.
As a note, the problem starts since version 2.10.13.

I've added this to the end of a default skeleton:

exports.modules = {
  autoRequire: {'app.js': ['test/initialize']}
}

Seems to be working just fine. Can you provide a repository with the issue?

Hello 👋

Sure ! You can find the repository with the issue, here

Commit that caused the issue: 4f6c24d

2.10.16 is out

Nice, thanks you @paulmillr ! 👌