Skip to content

Commit b41d735

Browse files
authored
BUG: Prism production build failure + misc. (#858)
- Bandaid prism postcss minification bug by disabling CSS minification. For #857 as a temporary measure. - Add missing `docs/dist-prod/open-source/spectacle` symlink needed for `yarn prod:serve` - Catch `yarn.lock` up. This should fail yarn install in CI, so not sure if this is something just on my machine as I didn't change deps... - Lint was super slow, so I updated lints so docs one is more honed (had duplicates) and root project one now only lints specific dirs (it was doing way too many after docs addition of things that were not real source) and does the root + docs so you only really need the root one.
1 parent 5d627e6 commit b41d735

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../dist

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"check-ci": "yarn run lint",
1717
"clean": "rimraf dist",
1818
"format": "yarn run lint --fix && yarn run prettier-all",
19-
"lint": "eslint 'src/**/*.js' 'static-config-*/*.js' 'src/**/*.js' 'static.config.js'",
20-
"prettier-all": "prettier --write '{src,static-config-helpers,static-config-parts,static.config,scripts,lib}/**/*.{js,jsx}'",
19+
"lint": "eslint '*.js' src scripts 'static-config-*/*.js'",
20+
"prettier-all": "prettier --write '{src,static-config-helpers,static-config-parts,static.config,scripts}/**/*.{js,jsx}'",
2121
"preversion": "yarn run lint && yarn run build",
2222
"prod:build": "react-static build",
2323
"prod:deploy": "node scripts/deploy/aws.js",

docs/static-config-parts/static-webpack-config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22
// THAT ENHANCES THE BASE REACT-STATIC WEBPACK CONFIG.
33

44
const staticWebpackConfig = (config, { defaultLoaders }) => {
5+
// BUG/HACK: Disable CSS minification to avoid module build error:
6+
// "Module build failed: BrowserslistError: Unknown browser query `dead`"
7+
// https://github.com/FormidableLabs/spectacle/issues/857
8+
defaultLoaders.cssLoader.loader.forEach(({ loader, options }) => {
9+
if (loader === 'css-loader') {
10+
options.minimize = false;
11+
}
12+
});
13+
14+
// Add development file info.
15+
config.output.pathinfo =
16+
config.output.pathinfo || process.env.REACT_STATIC_ENV === 'development';
17+
// No source maps.
518
config.devtool = false;
19+
20+
// Enhance rules.
621
config.module.rules = [
722
{
823
oneOf: [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"check": "yarn lint && yarn prettier-check && yarn test",
1313
"check-ci": "yarn run check",
1414
"format": "yarn run lint-fix && yarn run prettier-fix",
15-
"lint": "eslint --ignore-path .gitignore .",
15+
"lint": "eslint '*.js' 'examples/**/*.js' src scripts 'docs/*.js' docs/src docs/scripts 'docs/static-config-*/*.js'",
1616
"lint-fix": "yarn lint --fix",
1717
"prettier": "prettier \"**/*.{js,json,ts,css,md}\"",
1818
"prettier-check": "yarn prettier --check",

yarn.lock

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6309,7 +6309,7 @@ react-is@^16.12.0, react-is@^16.8.4:
63096309
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
63106310
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==
63116311

6312-
react-is@^16.6.0, react-is@^16.8.1, react-is@^16.8.6, react-is@^16.9.0:
6312+
react-is@^16.6.0, react-is@^16.8.1, react-is@^16.9.0:
63136313
version "16.9.0"
63146314
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb"
63156315
integrity sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==
@@ -6733,6 +6733,14 @@ sax@^1.2.4:
67336733
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
67346734
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
67356735

6736+
scheduler@^0.15.0:
6737+
version "0.15.0"
6738+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.15.0.tgz#6bfcf80ff850b280fed4aeecc6513bc0b4f17f8e"
6739+
integrity sha512-xAefmSfN6jqAa7Kuq7LIJY0bwAPG3xlCj0HMEBQk1lxYiDKZscY2xJ5U/61ZTrYbmNQbXa+gc7czPkVo11tnCg==
6740+
dependencies:
6741+
loose-envify "^1.1.0"
6742+
object-assign "^4.1.1"
6743+
67366744
scheduler@^0.18.0:
67376745
version "0.18.0"
67386746
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.18.0.tgz#5901ad6659bc1d8f3fdaf36eb7a67b0d6746b1c4"

0 commit comments

Comments
 (0)