forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LEOP-287]Apply all customize features to CRA5-Part2 (#145)
* Update paths/depencies/readme and changelog * Update config file and custom config * Update scripts files and related other files * Update lock file * perfect some annotation * Add comments * add some comments and remove cache-loader * remove writeToDisk configration * Remove extra space from the end line * remove cache-loader config and comment * Add nackpack-addons comment and restore code * Update version and changelog * Update packages/react-scripts/package.json Co-authored-by: Jayson Wu <jaysonwu991@outlook.com> Co-authored-by: Jayson Wu <jaysonwu991@outlook.com>
- Loading branch information
1 parent
e966830
commit 71ee671
Showing
15 changed files
with
3,497 additions
and
555 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
# react-scripts | ||
# backpack-react-scripts | ||
|
||
This package includes scripts and configuration used by [Create React App](https://github.com/facebook/create-react-app).<br> | ||
Please refer to its documentation: | ||
### **Important:** The currently supported version of **CRA** by `backpack-react-scripts` is up to `v5+`. Versions above this may not work. | ||
|
||
- [Getting Started](https://facebook.github.io/create-react-app/docs/getting-started) – How to create a new app. | ||
- [User Guide](https://facebook.github.io/create-react-app/) – How to develop apps bootstrapped with Create React App. | ||
This package is a fork of [Create React App](https://github.com/facebookincubator/create-react-app) (specifically the | ||
`react-scripts` package). It's intended to be used in conjuction with `create-react-app` like so: | ||
|
||
```sh | ||
npx create-react-app my-app --scripts-version=@skyscanner/backpack-react-scripts --template @skyscanner/backpack --use-npm | ||
|
||
# start your app development like you normally would with `create-react-app` | ||
cd my-app | ||
npm start | ||
``` | ||
|
||
## What is different in our fork? | ||
|
||
- Compilation of uncompiled Backpack components (specifically JSX). | ||
- Skyscanner specific template with Backpack components integrated out of the box. Published as `@skyscanner/cra-template-backpack` | ||
- CSS Modules enabled by default for all `.css` & `.scss` files. | ||
- Ability to create a bundle for server side rending. | ||
- Automatic chunking is disabled by default. | ||
- **`css.html` & `js.html`**: New files in the `build/` output folder. These are html partials that include `<script />` and `<link />` references to the various static assets output by webpack. Useful if automatic chunking is turned on and you don't want to worry about order. | ||
- A bunch of configuration options via `"backpack-react-scripts"` field in `package.json`: | ||
- `crossOriginLoading`: Modify the default behaviour, see [docs](https://webpack.js.org/configuration/output/#output-crossoriginloading). | ||
- `babelIncludePrefixes`: An array of module name prefixes to opt into babel compilation. Includes `["@skyscanner/bpk-", "bpk-", "saddlebag-"]` by default. | ||
- `enableAutomaticChunking`: Boolean, opt in to automatic chunking of vendor, common and app code. | ||
- `vendorsChunkRegex`: String, Regex for picking what goes into the `vendors` chunk. See `cacheGroups` in webpack docs. Dependent on `enableAutomaticChunking` being enabled | ||
- `amdExcludes`: Array of module names to exclude from AMD parsing. Incldues `["lodash"]` by default. | ||
- `externals`: exposing the Webpack config to modify externals, see [docs](https://webpack.js.org/configuration/externals/). | ||
- `ssrExternals`: Similar to above, but for `ssr.js` only. | ||
- `cssModules`: Boolean, true by default. | ||
- `sriEnabled`: Sets if SRI is to be used during build to add integrity hash for files, see [docs](https://github.com/waysact/webpack-subresource-integrity/blob/master/README.md). | ||
- **Note** if this is enabled, `crossOriginLoading` value is overriden with `anonymous` in order for it to output with the integrity value. | ||
- `ignoreCssWarnings`: Boolean, false by default. Allows the ability to supress CSS ordering issues when its safe to allow mixed order when it has not effect on output, see [docs](https://github.com/webpack-contrib/mini-css-extract-plugin#remove-order-warnings). False by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<% _.each(htmlWebpackPlugin.files.css, file => { %><link | ||
rel="stylesheet" | ||
href="<%= file %>" | ||
/> | ||
<% }); %> | ||
|
||
rel="stylesheet" | ||
href="<%= file %>" | ||
/> | ||
<% }); %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<% _.each(htmlWebpackPlugin.files.js, file => { %> | ||
<script src="<%= file %>"></script> | ||
<% }); %> | ||
|
||
<script src="<%= file %>"></script> | ||
<% }); %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.