Skip to content

tadatuta/rewire-entry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rewire-entry

Rewire for react-app-rewired to change entry points of create-react-app.

Usage

npm install react-app-rewired rewire-entry --save-dev

Create a config-overrides.js file in the root directory with something like this:

const rewireEntry = require('rewire-entry');

module.exports = rewireEntry({
  entry: ['desktop.js', 'touch.js']
});

or for typescript support:

const rewireTypescript = require('react-app-rewire-typescript');
const rewireEntry = require('rewire-entry')({
  entry: ['desktop.tsx', 'touch.tsx']
});

module.exports = {
  webpack: (config, env) => {
    config = rewireTypescript(config, env);
    config = rewireEntry.webpack(config, env);

    return config;
  },
  devServer: (config, env) => {
    config = rewireEntry.devServer(config, env);

    return config;
  }
};

Releases

No releases published

Packages

No packages published