js-build-tools 5.3.2 → 5.5.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.
- package/dist/build.js +63 -63
- package/dist/bundle.js +51 -28
- package/dist/bundle.min.js +1 -1
- package/dist/bundleLint.js +25 -17
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +22 -14
- package/dist/bundleMinify.min.js +1 -1
- package/dist/partials/imagesFor.js +42 -42
- package/dist/partials/loadPeer.js +70 -70
- package/dist/partials/standardLint.js +73 -73
- package/dist/partials/tsFor.js +70 -70
- package/dist/partials.js +136 -136
- package/dist/typeDocs.js +9 -9
- package/dist/utilities/getBundleConfigs.js +36 -0
- package/functions/bundle.mjs +30 -16
- package/functions/bundle.test.mjs +77 -0
- package/functions/bundleLint.mjs +8 -2
- package/functions/bundleLint.test.mjs +20 -0
- package/functions/bundleMinify.mjs +9 -2
- package/functions/bundleMinify.test.mjs +24 -2
- package/functions/utilities/getBundleConfigs.mjs +29 -0
- package/gulp.config.mjs +15 -0
- package/package.json +2 -1
package/dist/build.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
})
|
|
7
|
-
exports.build = void 0
|
|
8
|
-
const _bundle = require('./bundle.js')
|
|
9
|
-
const _bundleLint = require('./bundleLint.js')
|
|
10
|
-
const _bundleMinify = require('./bundleMinify.js')
|
|
11
|
-
const _partials = require('./partials.js')
|
|
12
|
-
const _compileReadme = require('./compileReadme.js')
|
|
13
|
-
const _typeDocs = require('./typeDocs.js')
|
|
14
|
-
const _distLint = require('./distLint.js')
|
|
15
|
-
const _distMinify = require('./distMinify.js')
|
|
16
|
-
const _gulp = require('gulp')
|
|
17
|
-
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
18
|
-
const _copyFonts = require('./copyFonts.js')
|
|
19
|
-
const _images = require('./images.js')
|
|
20
|
-
const _sass = require('./sass.js')
|
|
21
|
-
const _testFull = require('./testFull.js')
|
|
22
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.build = void 0
|
|
8
|
+
const _bundle = require('./bundle.js')
|
|
9
|
+
const _bundleLint = require('./bundleLint.js')
|
|
10
|
+
const _bundleMinify = require('./bundleMinify.js')
|
|
11
|
+
const _partials = require('./partials.js')
|
|
12
|
+
const _compileReadme = require('./compileReadme.js')
|
|
13
|
+
const _typeDocs = require('./typeDocs.js')
|
|
14
|
+
const _distLint = require('./distLint.js')
|
|
15
|
+
const _distMinify = require('./distMinify.js')
|
|
16
|
+
const _gulp = require('gulp')
|
|
17
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
18
|
+
const _copyFonts = require('./copyFonts.js')
|
|
19
|
+
const _images = require('./images.js')
|
|
20
|
+
const _sass = require('./sass.js')
|
|
21
|
+
const _testFull = require('./testFull.js')
|
|
22
|
+
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
|
|
23
23
|
/**
|
|
24
24
|
* Runs several processes to build and validate the project.
|
|
25
25
|
* Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
26
26
|
* @memberOf module:js-build-tools
|
|
27
27
|
* @returns {stream.Stream}
|
|
28
|
-
*/
|
|
29
|
-
const build = (done = null) => {
|
|
30
|
-
const distLintMinify = (0, _gulp.parallel)(_distLint.distLint, _distMinify.distMinify)
|
|
31
|
-
const bundleLintMinify = (0, _gulp.parallel)(_bundleLint.bundleLint, _bundleMinify.bundleMinify)
|
|
32
|
-
const buildActions = [(0, _partials.distSeries)(), distLintMinify]
|
|
33
|
-
const generateDocs = gulpConfig.get('docs.enabled')
|
|
34
|
-
if (generateDocs) {
|
|
35
|
-
// The documentation is generated from the TypeScript source itself, the readme is written by hand
|
|
36
|
-
buildActions.push(_typeDocs.typeDocs)
|
|
37
|
-
} else if (gulpConfig.get('typescript.enabled')) {
|
|
38
|
-
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
39
|
-
buildActions.push(_compileReadme.compileReadme)
|
|
40
|
-
}
|
|
41
|
-
if (gulpConfig.get('browser.enabled')) {
|
|
42
|
-
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
43
|
-
buildActions.push(_bundle.bundle)
|
|
44
|
-
buildActions.push(bundleLintMinify)
|
|
45
|
-
}
|
|
46
|
-
const runActions = [(0, _gulp.series)(...buildActions)]
|
|
47
|
-
if (!generateDocs && !gulpConfig.get('typescript.enabled')) {
|
|
48
|
-
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
49
|
-
runActions.push(_compileReadme.compileReadme)
|
|
50
|
-
}
|
|
51
|
-
runActions.push(_testFull.testFull)
|
|
52
|
-
if (gulpConfig.get('fonts.enabled')) {
|
|
53
|
-
// Conditionally add Fonts process
|
|
54
|
-
runActions.push(_copyFonts.copyFonts)
|
|
55
|
-
}
|
|
56
|
-
if (gulpConfig.get('images.enabled')) {
|
|
57
|
-
// Conditionally add Images process
|
|
58
|
-
runActions.push(_images.images)
|
|
59
|
-
}
|
|
60
|
-
if (gulpConfig.get('sass.enabled')) {
|
|
61
|
-
// Conditionally add SASS process
|
|
62
|
-
runActions.push(_sass.sass)
|
|
63
|
-
}
|
|
64
|
-
// clean has to finish before anything writes into the output folders - images, fonts and sass all write into
|
|
65
|
-
// browser/, so running clean in parallel with them races (ENOTEMPTY errors from clean, or output deleted mid-write).
|
|
66
|
-
return (0, _gulp.series)(_partials.clean, (0, _gulp.parallel)(...runActions))(done)
|
|
67
|
-
}
|
|
68
|
-
exports.build = build
|
|
28
|
+
*/
|
|
29
|
+
const build = (done = null) => {
|
|
30
|
+
const distLintMinify = (0, _gulp.parallel)(_distLint.distLint, _distMinify.distMinify)
|
|
31
|
+
const bundleLintMinify = (0, _gulp.parallel)(_bundleLint.bundleLint, _bundleMinify.bundleMinify)
|
|
32
|
+
const buildActions = [(0, _partials.distSeries)(), distLintMinify]
|
|
33
|
+
const generateDocs = gulpConfig.get('docs.enabled')
|
|
34
|
+
if (generateDocs) {
|
|
35
|
+
// The documentation is generated from the TypeScript source itself, the readme is written by hand
|
|
36
|
+
buildActions.push(_typeDocs.typeDocs)
|
|
37
|
+
} else if (gulpConfig.get('typescript.enabled')) {
|
|
38
|
+
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
39
|
+
buildActions.push(_compileReadme.compileReadme)
|
|
40
|
+
}
|
|
41
|
+
if (gulpConfig.get('browser.enabled')) {
|
|
42
|
+
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
43
|
+
buildActions.push(_bundle.bundle)
|
|
44
|
+
buildActions.push(bundleLintMinify)
|
|
45
|
+
}
|
|
46
|
+
const runActions = [(0, _gulp.series)(...buildActions)]
|
|
47
|
+
if (!generateDocs && !gulpConfig.get('typescript.enabled')) {
|
|
48
|
+
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
49
|
+
runActions.push(_compileReadme.compileReadme)
|
|
50
|
+
}
|
|
51
|
+
runActions.push(_testFull.testFull)
|
|
52
|
+
if (gulpConfig.get('fonts.enabled')) {
|
|
53
|
+
// Conditionally add Fonts process
|
|
54
|
+
runActions.push(_copyFonts.copyFonts)
|
|
55
|
+
}
|
|
56
|
+
if (gulpConfig.get('images.enabled')) {
|
|
57
|
+
// Conditionally add Images process
|
|
58
|
+
runActions.push(_images.images)
|
|
59
|
+
}
|
|
60
|
+
if (gulpConfig.get('sass.enabled')) {
|
|
61
|
+
// Conditionally add SASS process
|
|
62
|
+
runActions.push(_sass.sass)
|
|
63
|
+
}
|
|
64
|
+
// clean has to finish before anything writes into the output folders - images, fonts and sass all write into
|
|
65
|
+
// browser/, so running clean in parallel with them races (ENOTEMPTY errors from clean, or output deleted mid-write).
|
|
66
|
+
return (0, _gulp.series)(_partials.clean, (0, _gulp.parallel)(...runActions))(done)
|
|
67
|
+
}
|
|
68
|
+
exports.build = build
|
package/dist/bundle.js
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
})
|
|
7
|
-
exports.bundle = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.bundle = void 0
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js')
|
|
10
|
+
const _browserify = _interopRequireDefault(require('browserify'))
|
|
11
|
+
const _gulp = require('gulp')
|
|
12
|
+
const _mergeStream = _interopRequireDefault(require('merge-stream'))
|
|
13
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
14
|
+
const _vinylSourceStream = _interopRequireDefault(require('vinyl-source-stream'))
|
|
15
|
+
const _getBundleConfigs = require('./utilities/getBundleConfigs.js')
|
|
16
|
+
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
|
|
17
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
14
18
|
/**
|
|
15
|
-
* Starting at
|
|
19
|
+
* Starting at each bundle's own entry point (dist.main for the primary bundle, or its own
|
|
20
|
+
* override from browser.bundles), bundle all the reachable files into a single file per bundle and
|
|
21
|
+
* store them in the specified output directory. A project with no browser.bundles entries gets
|
|
22
|
+
* exactly the one bundle it always did; each additional entry produces its own separate bundle
|
|
23
|
+
* (for example, a render-only variant built from a different entry point than the full bundle).
|
|
24
|
+
*
|
|
25
|
+
* A bundle's name does double duty: it names the output file (name.js) and, via browserify's
|
|
26
|
+
* `standalone` option, is also the name its exports are exposed under - as a global when loaded
|
|
27
|
+
* with a bare <script> tag, or as the module when required via CommonJS/AMD. Without this, a
|
|
28
|
+
* bundle built from a real entry point (one that actually exports something) builds successfully
|
|
29
|
+
* but exposes nothing a consumer can reach.
|
|
16
30
|
*
|
|
17
31
|
* Two escape hatches from browser.config.json keep an unwanted dependency (or a dependency's dependency) out of the
|
|
18
32
|
* bundle: 'ignore' replaces it with an empty object (safe when your code never actually calls into it - for example
|
|
@@ -20,17 +34,26 @@ function _interopRequireDefault (e) { return e && e.__esModule ? e : { default:
|
|
|
20
34
|
* code must not require it, or provide it another way, such as a separate script tag).
|
|
21
35
|
* @memberOf module:js-build-tools
|
|
22
36
|
* @returns {stream.Stream}
|
|
23
|
-
*/
|
|
24
|
-
const bundle = () => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
+
*/
|
|
38
|
+
const bundle = () => (0, _mergeStream.default)((0, _getBundleConfigs.getBundleConfigs)().map(({
|
|
39
|
+
name,
|
|
40
|
+
main,
|
|
41
|
+
ignore,
|
|
42
|
+
exclude
|
|
43
|
+
}) => {
|
|
44
|
+
const bundler = (0, _browserify.default)(main, {
|
|
45
|
+
standalone: name
|
|
46
|
+
})
|
|
47
|
+
if (ignore && ignore.length) {
|
|
48
|
+
bundler.ignore(ignore)
|
|
49
|
+
}
|
|
50
|
+
if (exclude && exclude.length) {
|
|
51
|
+
bundler.exclude(exclude)
|
|
52
|
+
}
|
|
53
|
+
return bundler.bundle().pipe((0, _vinylSourceStream.default)(`${name}.js`))
|
|
54
|
+
})
|
|
55
|
+
// One shared dest() for every bundle, not one per bundle - vinyl-fs's dest() races against
|
|
56
|
+
// itself (a real "write after end" failure) when two separate dest() streams target the same
|
|
57
|
+
// directory concurrently, which every additional bundle's own dest() call otherwise would.
|
|
58
|
+
).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')))
|
|
59
|
+
exports.bundle = bundle
|
package/dist/bundle.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.bundle=void 0;var _browserify=_interopRequireDefault(require("browserify")),_gulp=require("gulp"),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_vinylSourceStream=_interopRequireDefault(require("vinyl-source-stream"));function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var t=new WeakMap,u=new WeakMap;return(_interopRequireWildcard=function(e,r){if(!r&&e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(n=r?u:t){if(n.has(e))return n.get(e);n.set(e,o)}for(const r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,r))&&(i.get||i.set)?n(o,r,i):o[r]=e[r]);return o})(e,r)}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const bundle=()=>
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.bundle=void 0,require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.map.js");var _browserify=_interopRequireDefault(require("browserify")),_gulp=require("gulp"),_mergeStream=_interopRequireDefault(require("merge-stream")),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_vinylSourceStream=_interopRequireDefault(require("vinyl-source-stream")),_getBundleConfigs=require("./utilities/getBundleConfigs.js");function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var t=new WeakMap,u=new WeakMap;return(_interopRequireWildcard=function(e,r){if(!r&&e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(n=r?u:t){if(n.has(e))return n.get(e);n.set(e,o)}for(const r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,r))&&(i.get||i.set)?n(o,r,i):o[r]=e[r]);return o})(e,r)}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const bundle=()=>(0,_mergeStream.default)((0,_getBundleConfigs.getBundleConfigs)().map(({name:e,main:r,ignore:t,exclude:u})=>{const n=(0,_browserify.default)(r,{standalone:e});return t&&t.length&&n.ignore(t),u&&u.length&&n.exclude(u),n.bundle().pipe((0,_vinylSourceStream.default)(`${e}.js`))})).pipe((0,_gulp.dest)(gulpConfig.get("browser.to")));exports.bundle=bundle;
|
package/dist/bundleLint.js
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
})
|
|
7
|
-
exports.bundleLint = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.bundleLint = void 0
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js')
|
|
10
|
+
const _gulp = require('gulp')
|
|
11
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
12
|
+
const _standardLint = require('./partials/standardLint.js')
|
|
13
|
+
const _getBundleConfigs = require('./utilities/getBundleConfigs.js')
|
|
14
|
+
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
|
|
12
15
|
/**
|
|
13
|
-
* Applies Standard code style linting to bundled file
|
|
16
|
+
* Applies Standard code style linting to every bundled file (the primary bundle, plus any
|
|
17
|
+
* additional ones from browser.bundles). The lint step itself never varies per bundle, so this is
|
|
18
|
+
* one shared src()/dest() pipeline fed every bundle's filename at once, rather than one pipeline
|
|
19
|
+
* per bundle - gulp's src()/dest() both accept an array of paths natively.
|
|
14
20
|
* @memberOf module:js-build-tools
|
|
15
21
|
* @returns {stream.Stream}
|
|
16
|
-
*/
|
|
17
|
-
const bundleLint = () => (0, _gulp.src)(
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
22
|
+
*/
|
|
23
|
+
const bundleLint = () => (0, _gulp.src)((0, _getBundleConfigs.getBundleConfigs)().map(({
|
|
24
|
+
name
|
|
25
|
+
}) => `${gulpConfig.get('browser.to')}/${name}.js`)).pipe((0, _standardLint.standardLint)({
|
|
26
|
+
fix: true
|
|
27
|
+
})).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')))
|
|
28
|
+
exports.bundleLint = bundleLint
|
package/dist/bundleLint.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.bundleLint=void 0;var _gulp=require("gulp"),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_standardLint=require("./partials/standardLint.js");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var i,o,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(i=t?n:r){if(i.has(e))return i.get(e);i.set(e,u)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?i(u,t,o):u[t]=e[t]);return u})(e,t)}const bundleLint=()=>(0,_gulp.src)(
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.bundleLint=void 0,require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.map.js");var _gulp=require("gulp"),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_standardLint=require("./partials/standardLint.js"),_getBundleConfigs=require("./utilities/getBundleConfigs.js");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var i,o,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(i=t?n:r){if(i.has(e))return i.get(e);i.set(e,u)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?i(u,t,o):u[t]=e[t]);return u})(e,t)}const bundleLint=()=>(0,_gulp.src)((0,_getBundleConfigs.getBundleConfigs)().map(({name:e})=>`${gulpConfig.get("browser.to")}/${e}.js`)).pipe((0,_standardLint.standardLint)({fix:!0})).pipe((0,_gulp.dest)(gulpConfig.get("browser.to")));exports.bundleLint=bundleLint;
|
package/dist/bundleMinify.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
})
|
|
7
|
-
exports.bundleMinify = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.bundleMinify = void 0
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js')
|
|
10
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
11
|
+
const _minifyFor = require('./partials/minifyFor.js')
|
|
12
|
+
const _getBundleConfigs = require('./utilities/getBundleConfigs.js')
|
|
13
|
+
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
|
|
11
14
|
/**
|
|
12
|
-
* Creates the minified bundle
|
|
15
|
+
* Creates the minified file for every bundle (the primary bundle, plus any additional ones from
|
|
16
|
+
* browser.bundles). The minify step itself never varies per bundle, so this is one shared
|
|
17
|
+
* src()/dest() pipeline (inside minifyFor) fed every bundle's filename at once, rather than one
|
|
18
|
+
* pipeline per bundle - gulp's src() accepts an array of paths natively.
|
|
13
19
|
* @memberOf module:js-build-tools
|
|
14
20
|
* @returns {*}
|
|
15
|
-
*/
|
|
16
|
-
const bundleMinify = () => (0, _minifyFor.minifyFor)(
|
|
17
|
-
|
|
21
|
+
*/
|
|
22
|
+
const bundleMinify = () => (0, _minifyFor.minifyFor)((0, _getBundleConfigs.getBundleConfigs)().map(({
|
|
23
|
+
name
|
|
24
|
+
}) => `${gulpConfig.get('browser.to')}/${name}.js`), gulpConfig.get('browser.to'))
|
|
25
|
+
exports.bundleMinify = bundleMinify
|
package/dist/bundleMinify.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.bundleMinify=void 0;var gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_minifyFor=require("./partials/minifyFor.js");function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var i=new WeakMap,t=new WeakMap;return(_interopRequireWildcard=function(e,r){if(!r&&e&&e.__esModule)return e;var n,o,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(n=r?t:i){if(n.has(e))return n.get(e);n.set(e,u)}for(const r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((o=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,r))&&(o.get||o.set)?n(u,r,o):u[r]=e[r]);return u})(e,r)}const bundleMinify=()=>(0,_minifyFor.minifyFor)(
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.bundleMinify=void 0,require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.map.js");var gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_minifyFor=require("./partials/minifyFor.js"),_getBundleConfigs=require("./utilities/getBundleConfigs.js");function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var i=new WeakMap,t=new WeakMap;return(_interopRequireWildcard=function(e,r){if(!r&&e&&e.__esModule)return e;var n,o,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(n=r?t:i){if(n.has(e))return n.get(e);n.set(e,u)}for(const r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((o=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,r))&&(o.get||o.set)?n(u,r,o):u[r]=e[r]);return u})(e,r)}const bundleMinify=()=>(0,_minifyFor.minifyFor)((0,_getBundleConfigs.getBundleConfigs)().map(({name:e})=>`${gulpConfig.get("browser.to")}/${e}.js`),gulpConfig.get("browser.to"));exports.bundleMinify=bundleMinify;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.loadImagemin = exports.imagesFor = void 0;
|
|
8
|
-
var _gulpCache = _interopRequireDefault(require("gulp-cache"));
|
|
9
|
-
var _loadPeer = require("./loadPeer.js");
|
|
10
|
-
var _gulp = require("gulp");
|
|
11
|
-
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
12
|
-
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
13
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
const installHint = 'Add it to your project with: npm install --save-dev github:jheagle/gulp-imagemin#common-js-compatibility ' + '(the CommonJS-compatible fork - upstream gulp-imagemin is ESM-only and cannot be require()d by this package\'s CommonJS build).';
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.loadImagemin = exports.imagesFor = void 0;
|
|
8
|
+
var _gulpCache = _interopRequireDefault(require("gulp-cache"));
|
|
9
|
+
var _loadPeer = require("./loadPeer.js");
|
|
10
|
+
var _gulp = require("gulp");
|
|
11
|
+
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
12
|
+
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const installHint = 'Add it to your project with: npm install --save-dev github:jheagle/gulp-imagemin#common-js-compatibility ' + '(the CommonJS-compatible fork - upstream gulp-imagemin is ESM-only and cannot be require()d by this package\'s CommonJS build).';
|
|
16
|
+
|
|
17
17
|
/**
|
|
18
18
|
* Load `gulp-imagemin`, an optional peer dependency: image optimization is off by default and its binary-download
|
|
19
19
|
* dependency chain is heavy, so it is only required once the images task actually runs, and it is resolved from the
|
|
@@ -22,36 +22,36 @@ const installHint = 'Add it to your project with: npm install --save-dev github:
|
|
|
22
22
|
* @param {string} [projectPath=process.cwd()] - The project directory to resolve `gulp-imagemin` from.
|
|
23
23
|
* @returns {Function} The gulp-imagemin plugin factory.
|
|
24
24
|
* @throws {Error} With install instructions when gulp-imagemin is missing or is the ESM-only upstream release.
|
|
25
|
-
*/
|
|
26
|
-
const loadImagemin = (projectPath = process.cwd()) => {
|
|
27
|
-
const loaded = (0, _loadPeer.requirePeer)('gulp-imagemin', {
|
|
28
|
-
task: 'images',
|
|
29
|
-
installHint,
|
|
30
|
-
esmOnlyMessage: `gulp-imagemin could not be loaded because it is ESM-only. ${installHint}`,
|
|
31
|
-
projectPath
|
|
32
|
-
});
|
|
33
|
-
return loaded && (loaded.__esModule || loaded.default) ? loaded.default : loaded;
|
|
34
|
-
};
|
|
35
|
-
|
|
25
|
+
*/
|
|
26
|
+
const loadImagemin = (projectPath = process.cwd()) => {
|
|
27
|
+
const loaded = (0, _loadPeer.requirePeer)('gulp-imagemin', {
|
|
28
|
+
task: 'images',
|
|
29
|
+
installHint,
|
|
30
|
+
esmOnlyMessage: `gulp-imagemin could not be loaded because it is ESM-only. ${installHint}`,
|
|
31
|
+
projectPath
|
|
32
|
+
});
|
|
33
|
+
return loaded && (loaded.__esModule || loaded.default) ? loaded.default : loaded;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
36
|
/**
|
|
37
37
|
* Move and optimize images into the browser directory.
|
|
38
38
|
* @memberOf module:partials
|
|
39
39
|
* @param {string|array} [imageSrc=src/images/pattern]
|
|
40
40
|
* @param {string} [imageDest=dest/image/folder]
|
|
41
41
|
* @return {stream.Stream}
|
|
42
|
-
*/
|
|
43
|
-
exports.loadImagemin = loadImagemin;
|
|
44
|
-
const imagesFor = (imageSrc = gulpConfig.get('images.from'), imageDest = gulpConfig.get('images.to')) => {
|
|
45
|
-
const imagemin = loadImagemin();
|
|
46
|
-
// Gulp 5 reads files as utf8 text unless told otherwise, which corrupts binary images (and makes gulp-cache drop them).
|
|
47
|
-
return (0, _gulp.src)(imageSrc, {
|
|
48
|
-
encoding: false
|
|
49
|
-
}).pipe(
|
|
50
|
-
// Caching images that ran through imagemin
|
|
51
|
-
(0, _gulpCache.default)(imagemin({
|
|
52
|
-
interlaced: true,
|
|
53
|
-
silent: true,
|
|
54
|
-
verbose: false
|
|
55
|
-
}))).pipe((0, _gulp.dest)(imageDest));
|
|
56
|
-
};
|
|
42
|
+
*/
|
|
43
|
+
exports.loadImagemin = loadImagemin;
|
|
44
|
+
const imagesFor = (imageSrc = gulpConfig.get('images.from'), imageDest = gulpConfig.get('images.to')) => {
|
|
45
|
+
const imagemin = loadImagemin();
|
|
46
|
+
// Gulp 5 reads files as utf8 text unless told otherwise, which corrupts binary images (and makes gulp-cache drop them).
|
|
47
|
+
return (0, _gulp.src)(imageSrc, {
|
|
48
|
+
encoding: false
|
|
49
|
+
}).pipe(
|
|
50
|
+
// Caching images that ran through imagemin
|
|
51
|
+
(0, _gulpCache.default)(imagemin({
|
|
52
|
+
interlaced: true,
|
|
53
|
+
silent: true,
|
|
54
|
+
verbose: false
|
|
55
|
+
}))).pipe((0, _gulp.dest)(imageDest));
|
|
56
|
+
};
|
|
57
57
|
exports.imagesFor = imagesFor;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.requirePeer = exports.importPeer = exports.importModule = void 0;
|
|
7
|
-
require("core-js/modules/es.array.includes.js");
|
|
8
|
-
var _nodeModule = require("node:module");
|
|
9
|
-
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
10
|
-
var _nodeUrl = require("node:url");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
// Several dependencies ship ESM-only (standard, gulp-ts-compile, typedoc), but this package also publishes a CommonJS
|
|
13
|
-
// build (dist/*.js) whose babel transform would turn even a dynamic import() into a require() that cannot load an ES
|
|
14
|
-
// module. Hiding the import() inside a Function constructor keeps it a genuine dynamic import that works from either
|
|
15
|
-
// build, because babel cannot see (and so cannot rewrite) an import expression which only exists as a runtime string.
|
|
16
|
-
const dynamicImport = new Function('specifier', 'return import(specifier)');
|
|
17
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.requirePeer = exports.importPeer = exports.importModule = void 0;
|
|
7
|
+
require("core-js/modules/es.array.includes.js");
|
|
8
|
+
var _nodeModule = require("node:module");
|
|
9
|
+
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
10
|
+
var _nodeUrl = require("node:url");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
// Several dependencies ship ESM-only (standard, gulp-ts-compile, typedoc), but this package also publishes a CommonJS
|
|
13
|
+
// build (dist/*.js) whose babel transform would turn even a dynamic import() into a require() that cannot load an ES
|
|
14
|
+
// module. Hiding the import() inside a Function constructor keeps it a genuine dynamic import that works from either
|
|
15
|
+
// build, because babel cannot see (and so cannot rewrite) an import expression which only exists as a runtime string.
|
|
16
|
+
const dynamicImport = new Function('specifier', 'return import(specifier)');
|
|
17
|
+
|
|
18
18
|
/**
|
|
19
19
|
* Import an ES module (or any module) with a real dynamic import(), whichever build (ESM or CommonJS) this runs from.
|
|
20
20
|
* @memberOf module:partials
|
|
21
21
|
* @param {string} specifier - The package name, or the URL of a file.
|
|
22
22
|
* @returns {Promise<Object>} The module namespace.
|
|
23
|
-
*/
|
|
24
|
-
const importModule = specifier => dynamicImport(specifier);
|
|
25
|
-
exports.importModule = importModule;
|
|
26
|
-
const isMissing = (error, name) => error.code === 'MODULE_NOT_FOUND' && error.message.includes(`'${name}'`);
|
|
27
|
-
const notInstalled = (name, {
|
|
28
|
-
task,
|
|
29
|
-
installHint
|
|
30
|
-
}) => new Error(`The ${task} task needs the optional peer dependency ${name}, which is not installed. ${installHint}`);
|
|
31
|
-
|
|
23
|
+
*/
|
|
24
|
+
const importModule = specifier => dynamicImport(specifier);
|
|
25
|
+
exports.importModule = importModule;
|
|
26
|
+
const isMissing = (error, name) => error.code === 'MODULE_NOT_FOUND' && error.message.includes(`'${name}'`);
|
|
27
|
+
const notInstalled = (name, {
|
|
28
|
+
task,
|
|
29
|
+
installHint
|
|
30
|
+
}) => new Error(`The ${task} task needs the optional peer dependency ${name}, which is not installed. ${installHint}`);
|
|
31
|
+
|
|
32
32
|
/**
|
|
33
33
|
* Load an optional peer dependency (one which is only needed once a task runs, so projects which never use that task
|
|
34
34
|
* do not have to install it) with require(), from the project being built rather than from this package. When it is
|
|
@@ -42,29 +42,29 @@ const notInstalled = (name, {
|
|
|
42
42
|
* @param {string} [options.projectPath=process.cwd()] - The folder of the project (which has the package.json) being built.
|
|
43
43
|
* @returns {*} Whatever the package exports.
|
|
44
44
|
* @throws {Error} With install instructions when the package is not installed.
|
|
45
|
-
*/
|
|
46
|
-
const requirePeer = (name, {
|
|
47
|
-
task,
|
|
48
|
-
installHint,
|
|
49
|
-
esmOnlyMessage,
|
|
50
|
-
projectPath = process.cwd()
|
|
51
|
-
}) => {
|
|
52
|
-
try {
|
|
53
|
-
return (0, _nodeModule.createRequire)(_nodePath.default.join(projectPath, 'package.json'))(name);
|
|
54
|
-
} catch (error) {
|
|
55
|
-
if (isMissing(error, name)) {
|
|
56
|
-
throw notInstalled(name, {
|
|
57
|
-
task,
|
|
58
|
-
installHint
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (error.code === 'ERR_REQUIRE_ESM' && esmOnlyMessage) {
|
|
62
|
-
throw new Error(esmOnlyMessage);
|
|
63
|
-
}
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
45
|
+
*/
|
|
46
|
+
const requirePeer = (name, {
|
|
47
|
+
task,
|
|
48
|
+
installHint,
|
|
49
|
+
esmOnlyMessage,
|
|
50
|
+
projectPath = process.cwd()
|
|
51
|
+
}) => {
|
|
52
|
+
try {
|
|
53
|
+
return (0, _nodeModule.createRequire)(_nodePath.default.join(projectPath, 'package.json'))(name);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
if (isMissing(error, name)) {
|
|
56
|
+
throw notInstalled(name, {
|
|
57
|
+
task,
|
|
58
|
+
installHint
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (error.code === 'ERR_REQUIRE_ESM' && esmOnlyMessage) {
|
|
62
|
+
throw new Error(esmOnlyMessage);
|
|
63
|
+
}
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
68
|
/**
|
|
69
69
|
* Import an optional peer dependency which ships ESM-only, from the project being built. See {@link requirePeer}.
|
|
70
70
|
* @memberOf module:partials
|
|
@@ -75,25 +75,25 @@ const requirePeer = (name, {
|
|
|
75
75
|
* @param {string} [options.projectPath=process.cwd()] - The folder of the project (which has the package.json) being built.
|
|
76
76
|
* @returns {Promise<Object>} The module namespace.
|
|
77
77
|
* @throws {Error} With install instructions when the package is not installed.
|
|
78
|
-
*/
|
|
79
|
-
exports.requirePeer = requirePeer;
|
|
80
|
-
const importPeer = async (name, {
|
|
81
|
-
task,
|
|
82
|
-
installHint,
|
|
83
|
-
projectPath = process.cwd()
|
|
84
|
-
}) => {
|
|
85
|
-
let resolved;
|
|
86
|
-
try {
|
|
87
|
-
resolved = (0, _nodeModule.createRequire)(_nodePath.default.join(projectPath, 'package.json')).resolve(name);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
if (isMissing(error, name)) {
|
|
90
|
-
throw notInstalled(name, {
|
|
91
|
-
task,
|
|
92
|
-
installHint
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
throw error;
|
|
96
|
-
}
|
|
97
|
-
return importModule((0, _nodeUrl.pathToFileURL)(resolved).href);
|
|
98
|
-
};
|
|
78
|
+
*/
|
|
79
|
+
exports.requirePeer = requirePeer;
|
|
80
|
+
const importPeer = async (name, {
|
|
81
|
+
task,
|
|
82
|
+
installHint,
|
|
83
|
+
projectPath = process.cwd()
|
|
84
|
+
}) => {
|
|
85
|
+
let resolved;
|
|
86
|
+
try {
|
|
87
|
+
resolved = (0, _nodeModule.createRequire)(_nodePath.default.join(projectPath, 'package.json')).resolve(name);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
if (isMissing(error, name)) {
|
|
90
|
+
throw notInstalled(name, {
|
|
91
|
+
task,
|
|
92
|
+
installHint
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
return importModule((0, _nodeUrl.pathToFileURL)(resolved).href);
|
|
98
|
+
};
|
|
99
99
|
exports.importPeer = importPeer;
|