backpack icon indicating copy to clipboard operation
backpack copied to clipboard

[help] transpiling code from node_modules

Open felipecodes opened this issue 6 years ago • 4 comments

How can I configure's bacpack to transpile some code from node_modules? I have 2 private package writen in esnext.

I see that node_modules is excluded.

I trying the following:

// backpack.config.js
webpack(config) {
  const jsRule = config.module.rules.find(rule => rule.test.test('.js'));
  delete jsRule.exclude;
}

Also tryed:

const jsrule = config.module.rules.find(rule => rule.test.test('.js'));
jsrule.include = [path.resolve('node_modules', 'dir-to-module')];

felipecodes avatar Jul 30 '18 21:07 felipecodes

I haven't tried this myself, I'm actually just getting started with backpack and came across this issue. But maybe you could push a new rule into config.module.rules?

See react-scripts which has a separate rule for transpiling node_modules.

adambrgmn avatar Sep 11 '18 13:09 adambrgmn

@felipe-coder were you able to figure it out?

@adambrgmn did you try the approach from react-scripts? I haven't had much luck

walleXD avatar Jul 19 '19 00:07 walleXD

@walleXD I remember that I gave it a try back when I commented on the issue and that it actually worked. But it's a while back and I haven't felt the need to transpile node_modules since then, so I'm not sure how if it works today.

adambrgmn avatar Aug 05 '19 09:08 adambrgmn

i've same problem and until now no solution

NourSammour avatar Sep 26 '19 11:09 NourSammour