create-packer 1.25.3 → 1.25.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.25.3",
3
+ "version": "1.25.4",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -1,10 +1,9 @@
1
- import { concat, forEach, isArray, isRegExp, keys, remove, size } from 'lodash-es'
1
+ import { concat, forEach, includes, isArray, isRegExp, keys, remove, size } from 'lodash-es'
2
2
  import pkg from '../package.json'
3
3
 
4
4
  export function createChunks(chunks: { [key: string]: Array<string | RegExp> }) {
5
- const result: { [key: string]: string[] } = {
6
- vendor: keys(pkg.dependencies)
7
- }
5
+ const vendor = keys(pkg.dependencies)
6
+ const result: { [key: string]: string[] } = {}
8
7
 
9
8
  forEach(chunks, (values, key) => {
10
9
  if (!isArray(result[key])) {
@@ -13,14 +12,15 @@ export function createChunks(chunks: { [key: string]: Array<string | RegExp> })
13
12
  forEach(values, value => {
14
13
  let modules: string[] = []
15
14
  if (isRegExp(value)) {
16
- modules = remove(result.vendor, name => value.test(name))
15
+ modules = remove(vendor, name => value.test(name))
17
16
  } else {
18
- modules = remove(result.vendor, name => name === value)
17
+ modules = remove(vendor, name => name === value)
19
18
  }
20
19
  if (size(modules) > 0) {
21
20
  result[key] = concat(result[key], modules)
22
21
  }
23
22
  })
24
23
  })
24
+ result.vendor = vendor
25
25
  return result
26
26
  }
@@ -1,10 +1,9 @@
1
- import { concat, forEach, isArray, isRegExp, keys, remove, size } from 'lodash-es'
1
+ import { concat, forEach, includes, isArray, isRegExp, keys, remove, size } from 'lodash-es'
2
2
  import pkg from '../package.json'
3
3
 
4
4
  export function createChunks(chunks: { [key: string]: Array<string | RegExp> }) {
5
- const result: { [key: string]: string[] } = {
6
- vendor: keys(pkg.dependencies)
7
- }
5
+ const vendor = keys(pkg.dependencies)
6
+ const result: { [key: string]: string[] } = {}
8
7
 
9
8
  forEach(chunks, (values, key) => {
10
9
  if (!isArray(result[key])) {
@@ -13,14 +12,15 @@ export function createChunks(chunks: { [key: string]: Array<string | RegExp> })
13
12
  forEach(values, value => {
14
13
  let modules: string[] = []
15
14
  if (isRegExp(value)) {
16
- modules = remove(result.vendor, name => value.test(name))
15
+ modules = remove(vendor, name => value.test(name))
17
16
  } else {
18
- modules = remove(result.vendor, name => name === value)
17
+ modules = remove(vendor, name => name === value)
19
18
  }
20
19
  if (size(modules) > 0) {
21
20
  result[key] = concat(result[key], modules)
22
21
  }
23
22
  })
24
23
  })
24
+ result.vendor = vendor
25
25
  return result
26
26
  }
@@ -0,0 +1,22 @@
1
+ # ignore most things, include some others
2
+ /*
3
+ /.*
4
+
5
+ !bin/
6
+ !lib/
7
+ !docs/
8
+ !package.json
9
+ !package-lock.json
10
+ !README.md
11
+ !CONTRIBUTING.md
12
+ !LICENSE
13
+ !CHANGELOG.md
14
+ !example/
15
+ !scripts/
16
+ !tap-snapshots/
17
+ !test/
18
+ !.travis.yml
19
+ !.gitignore
20
+ !.gitattributes
21
+ !coverage-map.js
22
+ !index.js
@@ -0,0 +1,22 @@
1
+ # ignore most things, include some others
2
+ /*
3
+ /.*
4
+
5
+ !bin/
6
+ !lib/
7
+ !docs/
8
+ !package.json
9
+ !package-lock.json
10
+ !README.md
11
+ !CONTRIBUTING.md
12
+ !LICENSE
13
+ !CHANGELOG.md
14
+ !example/
15
+ !scripts/
16
+ !tap-snapshots/
17
+ !test/
18
+ !.travis.yml
19
+ !.gitignore
20
+ !.gitattributes
21
+ !coverage-map.js
22
+ !index.js
@@ -0,0 +1,22 @@
1
+ # ignore most things, include some others
2
+ /*
3
+ /.*
4
+
5
+ !bin/
6
+ !lib/
7
+ !docs/
8
+ !package.json
9
+ !package-lock.json
10
+ !README.md
11
+ !CONTRIBUTING.md
12
+ !LICENSE
13
+ !CHANGELOG.md
14
+ !example/
15
+ !scripts/
16
+ !tap-snapshots/
17
+ !test/
18
+ !.travis.yml
19
+ !.gitignore
20
+ !.gitattributes
21
+ !coverage-map.js
22
+ !index.js
@@ -0,0 +1,24 @@
1
+ # ignore most things, include some others
2
+ /*
3
+ /.*
4
+
5
+ !bin/
6
+ !lib/
7
+ !docs/
8
+ !package.json
9
+ !package-lock.json
10
+ !README.md
11
+ !CONTRIBUTING.md
12
+ !LICENSE
13
+ !CHANGELOG.md
14
+ !example/
15
+ !scripts/
16
+ !tap-snapshots/
17
+ !test/
18
+ !.github/
19
+ !.travis.yml
20
+ !.gitignore
21
+ !.gitattributes
22
+ !coverage-map.js
23
+ !map.js
24
+ !index.js
@@ -0,0 +1,24 @@
1
+ # ignore most things, include some others
2
+ /*
3
+ /.*
4
+
5
+ !bin/
6
+ !lib/
7
+ !docs/
8
+ !package.json
9
+ !package-lock.json
10
+ !README.md
11
+ !CONTRIBUTING.md
12
+ !LICENSE
13
+ !CHANGELOG.md
14
+ !example/
15
+ !scripts/
16
+ !tap-snapshots/
17
+ !test/
18
+ !.github/
19
+ !.travis.yml
20
+ !.gitignore
21
+ !.gitattributes
22
+ !coverage-map.js
23
+ !map.js
24
+ !index.js
@@ -0,0 +1,24 @@
1
+ # ignore most things, include some others
2
+ /*
3
+ /.*
4
+
5
+ !bin/
6
+ !lib/
7
+ !docs/
8
+ !package.json
9
+ !package-lock.json
10
+ !README.md
11
+ !CONTRIBUTING.md
12
+ !LICENSE
13
+ !CHANGELOG.md
14
+ !example/
15
+ !scripts/
16
+ !tap-snapshots/
17
+ !test/
18
+ !.github/
19
+ !.travis.yml
20
+ !.gitignore
21
+ !.gitattributes
22
+ !coverage-map.js
23
+ !map.js
24
+ !index.js
@@ -0,0 +1,24 @@
1
+ # ignore most things, include some others
2
+ /*
3
+ /.*
4
+
5
+ !bin/
6
+ !lib/
7
+ !docs/
8
+ !package.json
9
+ !package-lock.json
10
+ !README.md
11
+ !CONTRIBUTING.md
12
+ !LICENSE
13
+ !CHANGELOG.md
14
+ !example/
15
+ !scripts/
16
+ !tap-snapshots/
17
+ !test/
18
+ !.github/
19
+ !.travis.yml
20
+ !.gitignore
21
+ !.gitattributes
22
+ !coverage-map.js
23
+ !map.js
24
+ !index.js