Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tadatuta/rewire-entry
Rewire to change entry points of create-react-app
https://github.com/tadatuta/rewire-entry
create-react-app react react-app-rewired reactjs webpack
Last synced: 30 days ago
JSON representation
Rewire to change entry points of create-react-app
- Host: GitHub
- URL: https://github.com/tadatuta/rewire-entry
- Owner: tadatuta
- Created: 2018-08-16T09:36:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-22T10:46:36.000Z (over 5 years ago)
- Last Synced: 2024-10-05T08:39:38.599Z (about 1 month ago)
- Topics: create-react-app, react, react-app-rewired, reactjs, webpack
- Language: JavaScript
- Size: 5.86 KB
- Stars: 27
- Watchers: 6
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rewire-entry
Rewire for [react-app-rewired](https://github.com/timarney/react-app-rewired) to change entry points of [create-react-app](https://github.com/facebook/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:
```js
const rewireEntry = require('rewire-entry');module.exports = rewireEntry({
entry: ['desktop.js', 'touch.js']
});
```or for typescript support:
```js
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;
}
};```