backpack
backpack copied to clipboard
[help] transpiling code from node_modules
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')];
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
.
@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 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.
i've same problem and until now no solution