Skip to content

Commit

Permalink
Added a staging build, with react-app-rewired.
Browse files Browse the repository at this point in the history
Such a simple patch. It's insane that there's still no flag for this in 2021. lol. facebook/create-react-app#790
  • Loading branch information
EricRabil committed Apr 7, 2021
1 parent d26bd98 commit c426927
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
11 changes: 11 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function override(config, env) {
if (process.env.STAGING) {
config.mode = "development";
config.optimization.minimize = false;
config.optimization.minimizer = [];

console.log("I'm making a ghetto production build.");
}

return config;
};
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"prosemirror-state": "^1.3.4",
"prosemirror-view": "^1.18.1",
"react": "^17.0.1",
"react-app-rewired": "^2.1.8",
"react-dom": "^17.0.1",
"react-git-info": "^2.0.0",
"react-json-view": "^1.21.3",
Expand All @@ -40,9 +41,10 @@
"uuid": "^8.3.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"start": "react-app-rewired start",
"build:staging": "STAGING=1 yarn build",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9556,6 +9556,13 @@ react-app-polyfill@^2.0.0:
regenerator-runtime "^0.13.7"
whatwg-fetch "^3.4.1"

react-app-rewired@^2.1.8:
version "2.1.8"
resolved "https://registry.npmjs.org/react-app-rewired/-/react-app-rewired-2.1.8.tgz#e192f93b98daf96889418d33d3e86cf863812b56"
integrity sha512-wjXPdKPLscA7mn0I1de1NHrbfWdXz4S1ladaGgHVKdn1hTgKK5N6EdGIJM0KrS6bKnJBj7WuqJroDTsPKKr66Q==
dependencies:
semver "^5.6.0"

react-base16-styling@^0.6.0:
version "0.6.0"
resolved "https://registry.npmjs.org/react-base16-styling/-/react-base16-styling-0.6.0.tgz#ef2156d66cf4139695c8a167886cb69ea660792c"
Expand Down

0 comments on commit c426927

Please sign in to comment.