Skip to content

Commit c426927

Browse files
committed
Added a staging build, with react-app-rewired.
Such a simple patch. It's insane that there's still no flag for this in 2021. lol. facebook/create-react-app#790
1 parent d26bd98 commit c426927

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

config-overrides.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = function override(config, env) {
2+
if (process.env.STAGING) {
3+
config.mode = "development";
4+
config.optimization.minimize = false;
5+
config.optimization.minimizer = [];
6+
7+
console.log("I'm making a ghetto production build.");
8+
}
9+
10+
return config;
11+
};

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"prosemirror-state": "^1.3.4",
2626
"prosemirror-view": "^1.18.1",
2727
"react": "^17.0.1",
28+
"react-app-rewired": "^2.1.8",
2829
"react-dom": "^17.0.1",
2930
"react-git-info": "^2.0.0",
3031
"react-json-view": "^1.21.3",
@@ -40,9 +41,10 @@
4041
"uuid": "^8.3.2"
4142
},
4243
"scripts": {
43-
"start": "react-scripts start",
44-
"build": "react-scripts build",
45-
"test": "react-scripts test",
44+
"start": "react-app-rewired start",
45+
"build:staging": "STAGING=1 yarn build",
46+
"build": "react-app-rewired build",
47+
"test": "react-app-rewired test",
4648
"eject": "react-scripts eject"
4749
},
4850
"eslintConfig": {

yarn.lock

+7
Original file line numberDiff line numberDiff line change
@@ -9556,6 +9556,13 @@ react-app-polyfill@^2.0.0:
95569556
regenerator-runtime "^0.13.7"
95579557
whatwg-fetch "^3.4.1"
95589558

9559+
react-app-rewired@^2.1.8:
9560+
version "2.1.8"
9561+
resolved "https://registry.npmjs.org/react-app-rewired/-/react-app-rewired-2.1.8.tgz#e192f93b98daf96889418d33d3e86cf863812b56"
9562+
integrity sha512-wjXPdKPLscA7mn0I1de1NHrbfWdXz4S1ladaGgHVKdn1hTgKK5N6EdGIJM0KrS6bKnJBj7WuqJroDTsPKKr66Q==
9563+
dependencies:
9564+
semver "^5.6.0"
9565+
95599566
react-base16-styling@^0.6.0:
95609567
version "0.6.0"
95619568
resolved "https://registry.npmjs.org/react-base16-styling/-/react-base16-styling-0.6.0.tgz#ef2156d66cf4139695c8a167886cb69ea660792c"

0 commit comments

Comments
 (0)