@financial-times/dotcom-build-code-splitting 2.6.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const memoize_one_1 = __importDefault(require("memoize-one"));
7
7
  const get_package_name_1 = __importDefault(require("get-package-name"));
8
- const moduleType = /(node_modules|bower_components)/;
8
+ const moduleType = /(node_modules)/;
9
9
  function extractPackageName(modulePath) {
10
10
  const type = modulePath.match(moduleType);
11
11
  return Array.isArray(type) ? get_package_name_1.default(modulePath, type[type.length - 1]) : null;
@@ -29,7 +29,7 @@ class PageKitCodeSplittingPlugin {
29
29
  const addComponentCodeSplitting = bundleTypes_1.createBundlesForRegExp({
30
30
  compiler,
31
31
  name: 'shared-components',
32
- pattern: /(node_modules\/@financial-times|bower_components)\/(o|n|x|next)-/,
32
+ pattern: /(node_modules\/@financial-times)\/(o|n|x|next)-/,
33
33
  usedInUnknownWay: true
34
34
  });
35
35
  // split all dotcom-ui- packages into one bundle file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/dotcom-build-code-splitting",
3
- "version": "2.6.1",
3
+ "version": "4.1.0",
4
4
  "description": "",
5
5
  "main": "dist/node/index.js",
6
6
  "types": "src/index.ts",
@@ -12,7 +12,8 @@
12
12
  "clean:node_modules": "rm -rf node_modules",
13
13
  "build": "npm run build:node",
14
14
  "build:node": "npm run tsc -- --module commonjs --outDir ./dist/node",
15
- "dev": "npm run build:node -- --watch"
15
+ "dev": "npm run build:node -- --watch",
16
+ "preinstall": "[ \"$INIT_CWD\" != \"$PWD\" ] || npm_config_yes=true npx check-engine"
16
17
  },
17
18
  "keywords": [],
18
19
  "author": "",
@@ -28,15 +29,20 @@
28
29
  "reliable-module-ids-plugin": "^1.0.1"
29
30
  },
30
31
  "devDependencies": {
31
- "@types/webpack": "^4.41.7"
32
+ "@types/webpack": "^4.41.7",
33
+ "check-engine": "^1.10.1"
32
34
  },
33
35
  "engines": {
34
- "node": ">= 12.0.0"
36
+ "node": ">= 12.0.0",
37
+ "npm": "7.x || 8.x"
35
38
  },
36
39
  "repository": {
37
40
  "type": "git",
38
41
  "repository": "https://github.com/Financial-Times/dotcom-page-kit.git",
39
42
  "directory": "packages/dotcom-build-code-splitting"
40
43
  },
41
- "homepage": "https://github.com/Financial-Times/dotcom-page-kit/tree/HEAD/packages/dotcom-build-code-splitting"
44
+ "homepage": "https://github.com/Financial-Times/dotcom-page-kit/tree/HEAD/packages/dotcom-build-code-splitting",
45
+ "volta": {
46
+ "extends": "../../package.json"
47
+ }
42
48
  }
@@ -1,7 +1,7 @@
1
1
  import memoize from 'memoize-one'
2
2
  import getPackageName from 'get-package-name'
3
3
 
4
- const moduleType = /(node_modules|bower_components)/
4
+ const moduleType = /(node_modules)/
5
5
 
6
6
  function extractPackageName(modulePath: string) {
7
7
  const type = modulePath.match(moduleType)
package/src/index.ts CHANGED
@@ -32,7 +32,7 @@ export class PageKitCodeSplittingPlugin {
32
32
  const addComponentCodeSplitting = createBundlesForRegExp({
33
33
  compiler,
34
34
  name: 'shared-components',
35
- pattern: /(node_modules\/@financial-times|bower_components)\/(o|n|x|next)-/,
35
+ pattern: /(node_modules\/@financial-times)\/(o|n|x|next)-/,
36
36
  usedInUnknownWay: true
37
37
  })
38
38
 
@@ -66,7 +66,7 @@ export class PageKitCodeSplittingPlugin {
66
66
  name: 'privacy-components',
67
67
  pattern: /@financial-times\/privacy-/,
68
68
  usedInUnknownWay: true
69
- });
69
+ })
70
70
 
71
71
  // split packages used by all pages (i.e. used by Page Kit) into a shared bundle
72
72
  const addSharedStableCodeSplitting = createBundleWithPackages({