Installations
npm install react-app-rewire-babel-loader
Developer
dashed
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
9.2.0
NPM Version
5.5.1
Statistics
22 Stars
10 Commits
3 Forks
3 Watching
1 Branches
1 Contributors
Updated on 31 Oct 2024
Bundle Size
2.64 kB
Minified
1.03 kB
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
819,336
Last day
9.2%
653
Compared to previous day
Last week
-20.5%
2,412
Compared to previous week
Last month
12.9%
12,689
Compared to previous month
Last year
0.8%
139,743
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
5
react-app-rewire-babel-loader
Rewire
babel-loader
loader in yourcreate-react-app
project usingreact-app-rewired
.
Say there is an awesome library you found on npm that you want to use within your un-ejected create-react-app
project, but unfortunately, it's published in ES6+ (since node_modules
doesn't go through babel-loader
), so you cannot really use it.
However, with react-app-rewired
and this library, react-app-rewire-babel-loader
, you can use that awesome library you've found.
See below for usage.
🚨 Not maintained for react-app-rewired v2.x.x+
I'm not maintaining this library for react-app-rewired
v2.x.x+.
Instead, please consider using: https://github.com/arackaf/customize-cra
The following essentially emulates react-app-rewire-babel-loader
which you can copy & paste into your override config file:
1// NOTE as of customize-cra v0.2.11 2 3const { babelInclude, getBabelLoader } = require("customize-cra"); 4 5const include = (config, ...includes) => { 6 return babelInclude(includes)(config); 7}; 8 9const babelExclude = exclude => config => { 10 getBabelLoader(config).exclude = exclude; 11 return config; 12}; 13 14const exclude = (config, ...excludes) => { 15 return babelExclude(excludes)(config); 16};
Install
1$ yarn add react-app-rewire-babel-loader 2# npm v5+ 3$ npm install react-app-rewire-babel-loader 4# before npm v5 5$ npm install --save react-app-rewire-babel-loader
Usage
1// config-overrides.js 2// see: https://github.com/timarney/react-app-rewired 3 4const path = require("path"); 5const fs = require("fs"); 6 7const rewireBabelLoader = require("react-app-rewire-babel-loader"); 8 9// helpers 10 11const appDirectory = fs.realpathSync(process.cwd()); 12const resolveApp = relativePath => path.resolve(appDirectory, relativePath); 13 14module.exports = function override(config, env) { 15 16 // white-list some npm modules to the babel-loader pipeline 17 // see: https://webpack.js.org/configuration/module/#rule-include 18 19 config = rewireBabelLoader.include( 20 config, 21 resolveApp("node_modules/isemail") 22 ); 23 24 // black-list some modules from the babel-loader pipeline 25 // see: https://webpack.js.org/configuration/module/#rule-exclude 26 27 config = rewireBabelLoader.exclude( 28 config, 29 /(node_modules|bower_components)/ 30 ); 31 32 return config; 33 34};
Development
node.js
andnpm
. See: https://github.com/creationix/nvm#installationyarn
. See: https://yarnpkg.com/en/docs/installnpm
dependencies. Run:yarn install
Chores
- Lint:
yarn run lint
- Prettier:
yarn run pretty
- Test:
yarn run test
- Pre-publish:
yarn run prepublish
- Build:
yarn run build
License
MIT.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
26 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to react-app-rewire-babel-loader
craco-babel-loader
Rewire `babel-loader` loader in your `create-react-app` project using `craco`.
react-app-rewired
Tweak the create-react-app webpack config(s) without using 'eject' and without creating a fork of the react-scripts
babel-plugin-rewire
A babel plugin adding the ability to rewire module dependencies. This enables to mock modules for testing purposes.
react-app-rewire-alias
Alias for craco or rewired create-react-app