package
Rewire `babel-loader` loader in your `create-react-app` project using `react-app-rewired`.
npm install react-app-rewire-babel-loaderGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Rewire
babel-loaderloader in yourcreate-react-appproject 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.
// config-overrides.js
// see: https://github.com/timarney/react-app-rewired
const path = require("path");
const fs = require("fs");
const rewireBabelLoader = require("react-app-rewire-babel-loader");
// helpers
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
module.exports = function override(config, env) {
// white-list some npm modules to the babel-loader pipeline
// see: https://webpack.js.org/configuration/module/#rule-include
node.js and npm. See: https://github.com/creationix/nvm#installationyarn. See: https://yarnpkg.com/en/docs/installnpm dependencies. Run: yarn installyarn run lintyarn run prettyyarn run testyarn run prepublishyarn run buildMIT.
Estimated unpacked size across 3 packages.
163.6 kB
Includes dependencies.