Skip to content

Add babel-plugin-import to a create-react-app app via react-app-rewired.

License

Notifications You must be signed in to change notification settings

brianveltman/react-app-rewire-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-app-rewire-import

npm version npm monthly downloads GitHub issues GitHub last commit npm

Compatible and tested with [email protected]

Add the import babel plugin to create-react-app using react-app-rewired

Installation

yarn add --dev react-app-rewire-import

or

npm install --save-dev  react-app-rewire-import

Usage

// config-overrides.js
const rewireImport = require('react-app-rewire-import');

module.exports = function override (config, env) {
  config = rewireImport(config, env);
  // other rewires...
  return config;
}

To pass options to the Babel plugin use the third argument, it passes straight through to the plugin:

config = rewireImport(config, env, {
  libraryName: 'antd',
  style: 'css'
})

See the available options in the babel-plugin-import documentation.

About

Add babel-plugin-import to a create-react-app app via react-app-rewired.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published