jaredpalmer / jaredpalmer/backpack
[help] transpiling code from node_modules
- Dominant language
- JavaScript
- Stars
- 4.4k
- Forks
- 164
- PR merge metrics
- No merged PRs in 30d
Description
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](https://github.com/jaredpalmer/backpack/blob/master/packages/backpack-core/config/webpack.config.js#L97).
I trying the following:
``` javascript
// backpack.config.js
webpack(config) {
const jsRule = config.module.rules.find(rule => rule.test.test('.js'));
delete jsRule.exclude;
}
```
Also tryed:
```javascript
const jsrule = config.module.rules.find(rule => rule.test.test('.js'));
jsrule.include = [path.resolve('node_modules', 'dir-to-module')];
```
Contributor guide
Research direction
Start with packages/backpack-core/config/webpack.config.js around the JavaScript rule and its node_modules exclusion, then compare that rule with the backpack.config.js examples in the issue. Determine how the two private ESNext packages should be selected for transpilation and verify that the resulting build processes them without applying the rule broadly to all of node_modules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100