Include node_modules babel Transformation

I would do it like this:

      app.build.rules.js
        .setExclude(undefined)
        .setInclude([app.path('src'), app.path('project', 'node_modules')]);

bud.build.items maps loaders to options. bud.build.rules is what you want here – the include/exclude paths are defined in regards to webpack rules, not loaders.

The include value(s) must be absolute paths to work in webpack. Your attempt wouldn’t work because 'node_modules' isn’t an absolute path.

app.path will provide you absolute paths or you can resolve them with node.

There is a PR open that will improve this API:

2 Likes