Skip to content

Commit f56ebba

Browse files
committed
[NO JIRA]: Backport updates
1 parent e70a008 commit f56ebba

File tree

6 files changed

+37
-11
lines changed

6 files changed

+37
-11
lines changed

packages/react-scripts/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# `backpack-react-scripts` Change Log
22

3+
## 8.0.6
4+
5+
- BACKPORT: Updated webpack paths to include the new `@skyscanner/bpk` foundations packages.
6+
37
## 8.0.4
48

59
- Updated `bpk-mixins` to latest version `20.1.5`
@@ -11,7 +15,8 @@
1115
- Downgraded `sass-loader` to `7.3.1` due to issues with `node-sass` and functional changes to options.
1216

1317
Rebased onto `upstream/master` v3.4.4 (6c009edface3ed63d0c7046f088c675a63c82fdb)
14-
- Update `resolve-url-loader` to `3.1.2` to resolve security vunerability
18+
19+
- Update `resolve-url-loader` to `3.1.2` to resolve security vunerability
1520

1621
## 8.0.2
1722

packages/react-scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ npm start
2323
- **`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.
2424
- A bunch of configuration options via `"backpack-react-scripts"` field in `package.json`:
2525
- `crossOriginLoading`: Modify the default behaviour, see [docs](https://webpack.js.org/configuration/output/#output-crossoriginloading).
26-
- `babelIncludePrefixes`: An array of module name prefixes to opt into babel compilation. Includes `["bpk-", "saddlebag-"]` by default.
26+
- `babelIncludePrefixes`: An array of module name prefixes to opt into babel compilation. Includes `["@skyscanner/bpk-", "bpk-", "saddlebag-"]` by default.
2727
- `enableAutomaticChunking`: Boolean, opt in to automatic chunking of vendor, common and app code.
2828
- `vendorsChunkRegex`: String, Regex for picking what goes into the `vendors` chunk. See `cacheGroups` in webpack docs. Dependent on `enableAutomaticChunking` being enabled
2929
- `amdExcludes`: Array of module names to exclude from AMD parsing. Incldues `["lodash"]` by default.

packages/react-scripts/config/webpack.config.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const sassModuleRegex = /\.module\.(scss|sass)$/;
7676
// Backpack / saddlebag node module regexes
7777
const backpackModulesRegex = /node_modules[\\/]bpk-/;
7878
const saddlebagModulesRegex = /node_modules[\\/]saddlebag-/;
79+
const scopedBackpackModulesRegex = /node_modules[\\/]@skyscanner[\\/]bpk-/;
7980

8081
// This is the production and development configuration.
8182
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
@@ -440,6 +441,7 @@ module.exports = function(webpackEnv) {
440441
paths.appSrc,
441442
backpackModulesRegex,
442443
saddlebagModulesRegex,
444+
scopedBackpackModulesRegex,
443445
...customModuleRegexes,
444446
],
445447
loader: require.resolve('babel-loader'),
@@ -539,7 +541,7 @@ module.exports = function(webpackEnv) {
539541
{
540542
test: {
541543
and: [cssRegex, () => !cssModulesEnabled],
542-
exclude: [backpackModulesRegex],
544+
exclude: [backpackModulesRegex, scopedBackpackModulesRegex],
543545
},
544546
exclude: cssModuleRegex,
545547
use: getStyleLoaders({
@@ -561,7 +563,11 @@ module.exports = function(webpackEnv) {
561563
and: [cssRegex, () => cssModulesEnabled],
562564
},
563565
{
564-
and: [cssRegex, backpackModulesRegex],
566+
and: [
567+
cssRegex,
568+
backpackModulesRegex,
569+
scopedBackpackModulesRegex,
570+
],
565571
},
566572
],
567573
use: getStyleLoaders({
@@ -578,7 +584,7 @@ module.exports = function(webpackEnv) {
578584
{
579585
test: {
580586
and: [sassRegex, () => !cssModulesEnabled],
581-
exclude: [backpackModulesRegex],
587+
exclude: [backpackModulesRegex, scopedBackpackModulesRegex],
582588
},
583589
exclude: sassModuleRegex,
584590
use: getStyleLoaders(
@@ -606,7 +612,11 @@ module.exports = function(webpackEnv) {
606612
and: [sassRegex, () => cssModulesEnabled],
607613
},
608614
{
609-
and: [sassRegex, backpackModulesRegex],
615+
and: [
616+
sassRegex,
617+
backpackModulesRegex,
618+
scopedBackpackModulesRegex,
619+
],
610620
},
611621
],
612622
use: getStyleLoaders(

packages/react-scripts/config/webpack.config.ssr.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const sassModuleRegex = /\.module\.(scss|sass)$/;
7373
// Backpack / saddlebag node module regexes
7474
const backpackModulesRegex = /node_modules[\\/]bpk-/;
7575
const saddlebagModulesRegex = /node_modules[\\/]saddlebag-/;
76+
const scopedBackpackModulesRegex = /node_modules[\\/]@skyscanner[\\/]bpk-/;
7677

7778
// This is the production and development configuration.
7879
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
@@ -417,6 +418,7 @@ module.exports = function(webpackEnv) {
417418
paths.appSrc,
418419
backpackModulesRegex,
419420
saddlebagModulesRegex,
421+
scopedBackpackModulesRegex,
420422
...customModuleRegexes,
421423
],
422424
loader: require.resolve('babel-loader'),
@@ -516,7 +518,7 @@ module.exports = function(webpackEnv) {
516518
{
517519
test: {
518520
and: [cssRegex, () => !cssModulesEnabled],
519-
exclude: [backpackModulesRegex],
521+
exclude: [backpackModulesRegex, scopedBackpackModulesRegex],
520522
},
521523
exclude: cssModuleRegex,
522524
use: getStyleLoaders({
@@ -538,7 +540,11 @@ module.exports = function(webpackEnv) {
538540
and: [cssRegex, () => cssModulesEnabled],
539541
},
540542
{
541-
and: [cssRegex, backpackModulesRegex],
543+
and: [
544+
cssRegex,
545+
backpackModulesRegex,
546+
scopedBackpackModulesRegex,
547+
],
542548
},
543549
],
544550
use: getStyleLoaders({
@@ -555,7 +561,7 @@ module.exports = function(webpackEnv) {
555561
{
556562
test: {
557563
and: [sassRegex, () => !cssModulesEnabled],
558-
exclude: [backpackModulesRegex],
564+
exclude: [backpackModulesRegex, scopedBackpackModulesRegex],
559565
},
560566
exclude: sassModuleRegex,
561567
use: getStyleLoaders(
@@ -583,7 +589,11 @@ module.exports = function(webpackEnv) {
583589
and: [sassRegex, () => cssModulesEnabled],
584590
},
585591
{
586-
and: [sassRegex, backpackModulesRegex],
592+
and: [
593+
sassRegex,
594+
backpackModulesRegex,
595+
scopedBackpackModulesRegex,
596+
],
587597
},
588598
],
589599
use: getStyleLoaders(

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@skyscanner/backpack-react-scripts",
3-
"version": "8.0.4",
3+
"version": "8.0.6",
44
"description": "Backpack configuration and scripts for Create React App.",
55
"repository": {
66
"type": "git",

packages/react-scripts/scripts/utils/createJestConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const pkgJson = require(paths.appPackageJson);
1616
const bpkReactScriptsConfig = pkgJson['backpack-react-scripts'] || {};
1717

1818
const includePrefixes = bpkReactScriptsConfig.babelIncludePrefixes || [];
19+
includePrefixes.unshift('@skyscanner/bpk-');
1920
includePrefixes.unshift('bpk-');
2021
includePrefixes.unshift('saddlebag-');
2122

0 commit comments

Comments
 (0)