Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[help] transpiling code from node_modules #131

Open
felipecodes opened this issue Jul 30, 2018 · 4 comments
Open

[help] transpiling code from node_modules #131

felipecodes opened this issue Jul 30, 2018 · 4 comments

Comments

@felipecodes
Copy link

felipecodes commented Jul 30, 2018

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 felipecodes changed the title transpiling code from node_modules [help] transpiling code from node_modules Jul 30, 2018
@adambrgmn
Copy link

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.

@walleXD
Copy link

walleXD commented Jul 19, 2019

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

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

@adambrgmn
Copy link

@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.

@NourSammour
Copy link

i've same problem and until now no solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants