Include node_modules babel Transformation

Hi there,
first of all, i started to use bud + sage 10 and they are fantastic!!
I’m trying to add in babel tranformation code from node_modules like this['babel'].mergeOptions(
      include: 'node_modules',

But not work, and babel stop to transform code of all project so, I tried to use an hook like this solution, but nothing works.

My configuration is default with bud 5.3.2 and sage 10-beta-3 (i changed only tailwind with bootstrap)

Thank you.

1 Like

I would do it like this:
        .setInclude([app.path('src'), app.path('project', 'node_modules')]); maps loaders to options. 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:


It’s work.
Thank you


@filpiro We released 5.4.0 and it removes excludes from all of the rules included in core.

The above fix should work without calling setExcludes:[
  app.path('project', 'node_modules'),