js-build-tools 4.1.0 → 5.0.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/README.md +274 -267
- package/dist/build.js +58 -56
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +16 -16
- package/dist/bundleLint.js +16 -20
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +13 -13
- package/dist/compileReadme.js +10 -10
- package/dist/copyFonts.js +13 -13
- package/dist/default.js +15 -15
- package/dist/dist.js +10 -10
- package/dist/distLint.js +16 -20
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +13 -13
- package/dist/images.js +10 -10
- package/dist/partials/copyFor.js +12 -9
- package/dist/partials/imagesFor.js +56 -21
- package/dist/partials/removeDirectory.js +37 -13
- package/dist/partials/sassFor.js +8 -2
- package/dist/partials/standardLint.js +96 -0
- package/dist/partials/tsFor.js +67 -59
- package/dist/partials.js +110 -103
- package/dist/partials.min.js +1 -1
- package/dist/sass.js +10 -10
- package/dist/test-helpers/standardLintWithRealStandard.js +28 -0
- package/dist/testFull.js +20 -21
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +10 -10
- package/dist/testQuick.js +22 -23
- package/dist/testQuick.min.js +1 -1
- package/dist/typeScript.js +9 -9
- package/dist/watchFull.js +10 -10
- package/dist/watchTest.js +16 -16
- package/functions/build.mjs +6 -3
- package/functions/build.test.mjs +31 -0
- package/functions/bundleLint.mjs +2 -6
- package/functions/bundleLint.test.mjs +3 -0
- package/functions/distLint.mjs +2 -6
- package/functions/distLint.test.mjs +3 -0
- package/functions/partials/copyFor.mjs +2 -1
- package/functions/partials/copyFor.test.mjs +18 -0
- package/functions/partials/imagesFor.mjs +35 -3
- package/functions/partials/imagesFor.test.mjs +83 -1
- package/functions/partials/removeDirectory.mjs +28 -14
- package/functions/partials/removeDirectory.test.mjs +44 -0
- package/functions/partials/sassFor.mjs +5 -2
- package/functions/partials/sassFor.test.mjs +22 -4
- package/functions/partials/standardLint.mjs +80 -0
- package/functions/partials/standardLint.test.mjs +99 -0
- package/functions/partials/tsFor.mjs +8 -1
- package/functions/partials.mjs +1 -0
- package/functions/partials.test.mjs +1 -1
- package/functions/test-helpers/standardLintWithRealStandard.mjs +21 -0
- package/functions/testFull.mjs +2 -2
- package/functions/testFull.test.mjs +2 -2
- package/functions/testQuick.mjs +2 -2
- package/functions/testQuick.test.mjs +2 -2
- package/package.json +19 -8
package/dist/build.js
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap()
|
|
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 _distLint = require('./distLint.js')
|
|
14
|
+
const _distMinify = require('./distMinify.js')
|
|
15
|
+
const _gulp = require('gulp')
|
|
16
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
17
|
+
const _copyFonts = require('./copyFonts.js')
|
|
18
|
+
const _images = require('./images.js')
|
|
19
|
+
const _sass = require('./sass.js')
|
|
20
|
+
const _testFull = require('./testFull.js')
|
|
21
|
+
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) }
|
|
22
22
|
/**
|
|
23
23
|
* Runs several processes to build and validate the project.
|
|
24
24
|
* Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
25
25
|
* @memberOf module:js-build-tools
|
|
26
26
|
* @returns {stream.Stream}
|
|
27
|
-
*/
|
|
28
|
-
const build = (done = null) => {
|
|
29
|
-
const distLintMinify = (0, _gulp.parallel)(_distLint.distLint, _distMinify.distMinify)
|
|
30
|
-
const bundleLintMinify = (0, _gulp.parallel)(_bundleLint.bundleLint, _bundleMinify.bundleMinify)
|
|
31
|
-
const buildActions = [
|
|
32
|
-
if (gulpConfig.get('typescript.enabled')) {
|
|
33
|
-
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
34
|
-
buildActions.push(_compileReadme.compileReadme)
|
|
35
|
-
}
|
|
36
|
-
if (gulpConfig.get('browser.enabled')) {
|
|
37
|
-
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
38
|
-
buildActions.push(_bundle.bundle)
|
|
39
|
-
buildActions.push(bundleLintMinify)
|
|
40
|
-
}
|
|
41
|
-
const runActions = [(0, _gulp.series)(...buildActions)]
|
|
42
|
-
if (!gulpConfig.get('typescript.enabled')) {
|
|
43
|
-
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
44
|
-
runActions.push(_compileReadme.compileReadme)
|
|
45
|
-
}
|
|
46
|
-
runActions.push(_testFull.testFull)
|
|
47
|
-
if (gulpConfig.get('fonts.enabled')) {
|
|
48
|
-
// Conditionally add Fonts process
|
|
49
|
-
runActions.push(_copyFonts.copyFonts)
|
|
50
|
-
}
|
|
51
|
-
if (gulpConfig.get('images.enabled')) {
|
|
52
|
-
// Conditionally add Images process
|
|
53
|
-
runActions.push(_images.images)
|
|
54
|
-
}
|
|
55
|
-
if (gulpConfig.get('sass.enabled')) {
|
|
56
|
-
// Conditionally add SASS process
|
|
57
|
-
runActions.push(_sass.sass)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
27
|
+
*/
|
|
28
|
+
const build = (done = null) => {
|
|
29
|
+
const distLintMinify = (0, _gulp.parallel)(_distLint.distLint, _distMinify.distMinify)
|
|
30
|
+
const bundleLintMinify = (0, _gulp.parallel)(_bundleLint.bundleLint, _bundleMinify.bundleMinify)
|
|
31
|
+
const buildActions = [(0, _partials.distSeries)(), distLintMinify]
|
|
32
|
+
if (gulpConfig.get('typescript.enabled')) {
|
|
33
|
+
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
34
|
+
buildActions.push(_compileReadme.compileReadme)
|
|
35
|
+
}
|
|
36
|
+
if (gulpConfig.get('browser.enabled')) {
|
|
37
|
+
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
38
|
+
buildActions.push(_bundle.bundle)
|
|
39
|
+
buildActions.push(bundleLintMinify)
|
|
40
|
+
}
|
|
41
|
+
const runActions = [(0, _gulp.series)(...buildActions)]
|
|
42
|
+
if (!gulpConfig.get('typescript.enabled')) {
|
|
43
|
+
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
44
|
+
runActions.push(_compileReadme.compileReadme)
|
|
45
|
+
}
|
|
46
|
+
runActions.push(_testFull.testFull)
|
|
47
|
+
if (gulpConfig.get('fonts.enabled')) {
|
|
48
|
+
// Conditionally add Fonts process
|
|
49
|
+
runActions.push(_copyFonts.copyFonts)
|
|
50
|
+
}
|
|
51
|
+
if (gulpConfig.get('images.enabled')) {
|
|
52
|
+
// Conditionally add Images process
|
|
53
|
+
runActions.push(_images.images)
|
|
54
|
+
}
|
|
55
|
+
if (gulpConfig.get('sass.enabled')) {
|
|
56
|
+
// Conditionally add SASS process
|
|
57
|
+
runActions.push(_sass.sass)
|
|
58
|
+
}
|
|
59
|
+
// clean has to finish before anything writes into the output folders - images, fonts and sass all write into
|
|
60
|
+
// browser/, so running clean in parallel with them races (ENOTEMPTY errors from clean, or output deleted mid-write).
|
|
61
|
+
return (0, _gulp.series)(_partials.clean, (0, _gulp.parallel)(...runActions))(done)
|
|
62
|
+
}
|
|
63
|
+
exports.build = build
|
package/dist/build.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.build=void 0;var _bundle=require("./bundle.js"),_bundleLint=require("./bundleLint.js"),_bundleMinify=require("./bundleMinify.js"),_partials=require("./partials.js"),_compileReadme=require("./compileReadme.js"),_distLint=require("./distLint.js"),_distMinify=require("./distMinify.js"),_gulp=require("gulp"),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_copyFonts=require("./copyFonts.js"),_images=require("./images.js"),_sass=require("./sass.js"),_testFull=require("./testFull.js");function _interopRequireWildcard(e,i){if("function"==typeof WeakMap)var s=new WeakMap,t=new WeakMap;return(_interopRequireWildcard=function(e,i){if(!i&&e&&e.__esModule)return e;var l,r,n={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return n;if(l=i?t:s){if(l.has(e))return l.get(e);l.set(e,n)}for(const i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((r=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,i))&&(r.get||r.set)?l(n,i,r):n[i]=e[i]);return n})(e,i)}const build=(e=null)=>{const i=(0,_gulp.parallel)(_distLint.distLint,_distMinify.distMinify),s=(0,_gulp.parallel)(_bundleLint.bundleLint,_bundleMinify.bundleMinify),t=[
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=void 0;var _bundle=require("./bundle.js"),_bundleLint=require("./bundleLint.js"),_bundleMinify=require("./bundleMinify.js"),_partials=require("./partials.js"),_compileReadme=require("./compileReadme.js"),_distLint=require("./distLint.js"),_distMinify=require("./distMinify.js"),_gulp=require("gulp"),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_copyFonts=require("./copyFonts.js"),_images=require("./images.js"),_sass=require("./sass.js"),_testFull=require("./testFull.js");function _interopRequireWildcard(e,i){if("function"==typeof WeakMap)var s=new WeakMap,t=new WeakMap;return(_interopRequireWildcard=function(e,i){if(!i&&e&&e.__esModule)return e;var l,r,n={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return n;if(l=i?t:s){if(l.has(e))return l.get(e);l.set(e,n)}for(const i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((r=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,i))&&(r.get||r.set)?l(n,i,r):n[i]=e[i]);return n})(e,i)}const build=(e=null)=>{const i=(0,_gulp.parallel)(_distLint.distLint,_distMinify.distMinify),s=(0,_gulp.parallel)(_bundleLint.bundleLint,_bundleMinify.bundleMinify),t=[(0,_partials.distSeries)(),i];gulpConfig.get("typescript.enabled")&&t.push(_compileReadme.compileReadme),gulpConfig.get("browser.enabled")&&(t.push(_bundle.bundle),t.push(s));const l=[(0,_gulp.series)(...t)];return gulpConfig.get("typescript.enabled")||l.push(_compileReadme.compileReadme),l.push(_testFull.testFull),gulpConfig.get("fonts.enabled")&&l.push(_copyFonts.copyFonts),gulpConfig.get("images.enabled")&&l.push(_images.images),gulpConfig.get("sass.enabled")&&l.push(_sass.sass),(0,_gulp.series)(_partials.clean,(0,_gulp.parallel)(...l))(e)};exports.build=build;
|
package/dist/bundle.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap()
|
|
13
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
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
|
+
const _browserify = _interopRequireDefault(require('browserify'))
|
|
9
|
+
const _gulp = require('gulp')
|
|
10
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
11
|
+
const _vinylSourceStream = _interopRequireDefault(require('vinyl-source-stream'))
|
|
12
|
+
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) }
|
|
13
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
14
14
|
/**
|
|
15
15
|
* Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.
|
|
16
16
|
* @memberOf module:js-build-tools
|
|
17
17
|
* @returns {stream.Stream}
|
|
18
|
-
*/
|
|
19
|
-
const bundle = () => (0, _browserify.default)(gulpConfig.get('dist.main')).bundle().pipe((0, _vinylSourceStream.default)(`${gulpConfig.get('browser.name')}.js`)).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')))
|
|
20
|
-
exports.bundle = bundle
|
|
18
|
+
*/
|
|
19
|
+
const bundle = () => (0, _browserify.default)(gulpConfig.get('dist.main')).bundle().pipe((0, _vinylSourceStream.default)(`${gulpConfig.get('browser.name')}.js`)).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')))
|
|
20
|
+
exports.bundle = bundle
|
package/dist/bundleLint.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
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
|
-
|
|
11
|
-
function
|
|
12
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(); var n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o; var i; var 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.bundleLint = void 0
|
|
8
|
+
const _gulp = require('gulp')
|
|
9
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
10
|
+
const _standardLint = require('./partials/standardLint.js')
|
|
11
|
+
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) }
|
|
13
12
|
/**
|
|
14
13
|
* Applies Standard code style linting to bundled file.
|
|
15
14
|
* @memberOf module:js-build-tools
|
|
16
15
|
* @returns {stream.Stream}
|
|
17
|
-
*/
|
|
18
|
-
const bundleLint = () => (0, _gulp.src)(`${gulpConfig.get('browser.to')}/${gulpConfig.get('browser.name')}.js`).pipe((0,
|
|
19
|
-
fix: true
|
|
20
|
-
})).pipe(
|
|
21
|
-
|
|
22
|
-
quiet: true
|
|
23
|
-
})).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')))
|
|
24
|
-
exports.bundleLint = bundleLint
|
|
16
|
+
*/
|
|
17
|
+
const bundleLint = () => (0, _gulp.src)(`${gulpConfig.get('browser.to')}/${gulpConfig.get('browser.name')}.js`).pipe((0, _standardLint.standardLint)({
|
|
18
|
+
fix: true
|
|
19
|
+
})).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')))
|
|
20
|
+
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")),
|
|
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)(`${gulpConfig.get("browser.to")}/${gulpConfig.get("browser.name")}.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,17 @@
|
|
|
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
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap()
|
|
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
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
9
|
+
const _minifyFor = require('./partials/minifyFor.js')
|
|
10
|
+
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
11
|
/**
|
|
12
12
|
* Creates the minified bundle file.
|
|
13
13
|
* @memberOf module:js-build-tools
|
|
14
14
|
* @returns {*}
|
|
15
|
-
*/
|
|
16
|
-
const bundleMinify = () => (0, _minifyFor.minifyFor)(`${gulpConfig.get('browser.to')}/${gulpConfig.get('browser.name')}.js`, gulpConfig.get('browser.to'))
|
|
17
|
-
exports.bundleMinify = bundleMinify
|
|
15
|
+
*/
|
|
16
|
+
const bundleMinify = () => (0, _minifyFor.minifyFor)(`${gulpConfig.get('browser.to')}/${gulpConfig.get('browser.name')}.js`, gulpConfig.get('browser.to'))
|
|
17
|
+
exports.bundleMinify = bundleMinify
|
package/dist/compileReadme.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.compileReadme = void 0
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.compileReadme = void 0
|
|
7
|
+
const _partials = require('./partials.js')
|
|
8
|
+
const _gulp = require('gulp')
|
|
9
9
|
/**
|
|
10
10
|
* Generate the README.md file based off of the template, then append the generated documentation.
|
|
11
11
|
* @memberOf module:js-build-tools
|
|
12
12
|
* @returns {stream.Stream}
|
|
13
|
-
*/
|
|
14
|
-
const compileReadme = exports.compileReadme = (0, _gulp.series)(_partials.readmeTemplate, _partials.addToReadme)
|
|
13
|
+
*/
|
|
14
|
+
const compileReadme = exports.compileReadme = (0, _gulp.series)(_partials.readmeTemplate, _partials.addToReadme)
|
package/dist/copyFonts.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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.copyFonts = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap()
|
|
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.copyFonts = void 0
|
|
8
|
+
const _copyFor = require('./partials/copyFor.js')
|
|
9
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
10
|
+
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
11
|
/**
|
|
12
12
|
* Move the font files into the browser directory.
|
|
13
13
|
* @memberOf module:js-build-tools
|
|
14
14
|
* @return {stream.Stream}
|
|
15
|
-
*/
|
|
16
|
-
const copyFonts = () => (0, _copyFor.copyFor)(gulpConfig.get('fonts.from'), gulpConfig.get('fonts.to'))
|
|
17
|
-
exports.copyFonts = copyFonts
|
|
15
|
+
*/
|
|
16
|
+
const copyFonts = () => (0, _copyFor.copyFor)(gulpConfig.get('fonts.from'), gulpConfig.get('fonts.to'))
|
|
17
|
+
exports.copyFonts = copyFonts
|
package/dist/default.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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.defaultCmd = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap()
|
|
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.defaultCmd = void 0
|
|
8
|
+
const _dist = require('./dist.js')
|
|
9
|
+
const _bundle = require('./bundle.js')
|
|
10
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
11
|
+
const _gulp = require('gulp')
|
|
12
|
+
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) }
|
|
13
13
|
/**
|
|
14
14
|
* Recommended as the default task, runs the simple dist and bundle tasks.
|
|
15
15
|
* @memberOf module:js-build-tools
|
|
16
16
|
* @param {function} [done=null]
|
|
17
17
|
* @returns {stream.Stream}
|
|
18
|
-
*/
|
|
19
|
-
const defaultCmd = (done = null) => gulpConfig.get('browser.enabled') ? (0, _gulp.series)(_dist.dist, _bundle.bundle)(done) : (0, _gulp.series)(_dist.dist)(done)
|
|
20
|
-
exports.defaultCmd = defaultCmd
|
|
18
|
+
*/
|
|
19
|
+
const defaultCmd = (done = null) => gulpConfig.get('browser.enabled') ? (0, _gulp.series)(_dist.dist, _bundle.bundle)(done) : (0, _gulp.series)(_dist.dist)(done)
|
|
20
|
+
exports.defaultCmd = defaultCmd
|
package/dist/dist.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.dist = void 0
|
|
7
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.dist = void 0
|
|
7
|
+
const _distFor = require('./partials/distFor.js')
|
|
8
8
|
/**
|
|
9
9
|
* Simplified distribution tasks which will use arguments from distFor.
|
|
10
10
|
* @memberOf module:js-build-tools
|
|
11
11
|
* @returns {*}
|
|
12
|
-
*/
|
|
13
|
-
const dist = () => (0, _distFor.distFor)()
|
|
14
|
-
exports.dist = dist
|
|
12
|
+
*/
|
|
13
|
+
const dist = () => (0, _distFor.distFor)()
|
|
14
|
+
exports.dist = dist
|
package/dist/distLint.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
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.distLint = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(); var n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o; var i; var 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.distLint = void 0
|
|
8
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
9
|
+
const _gulp = require('gulp')
|
|
10
|
+
const _standardLint = require('./partials/standardLint.js')
|
|
11
|
+
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) }
|
|
13
12
|
/**
|
|
14
13
|
* Applies Standard code style linting to distribution files.
|
|
15
14
|
* @memberOf module:js-build-tools
|
|
16
15
|
* @returns {*}
|
|
17
|
-
*/
|
|
18
|
-
const distLint = () => (0, _gulp.src)(gulpConfig.get('browser.from')).pipe((0,
|
|
19
|
-
fix: true
|
|
20
|
-
})).pipe(
|
|
21
|
-
|
|
22
|
-
quiet: true
|
|
23
|
-
})).pipe((0, _gulp.dest)(gulpConfig.get('dist.to')))
|
|
24
|
-
exports.distLint = distLint
|
|
16
|
+
*/
|
|
17
|
+
const distLint = () => (0, _gulp.src)(gulpConfig.get('browser.from')).pipe((0, _standardLint.standardLint)({
|
|
18
|
+
fix: true
|
|
19
|
+
})).pipe((0, _gulp.dest)(gulpConfig.get('dist.to')))
|
|
20
|
+
exports.distLint = distLint
|
package/dist/distLint.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.distLint=void 0;var gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_gulp=require("gulp"),
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.distLint=void 0;var gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_gulp=require("gulp"),_standardLint=require("./partials/standardLint.js");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,i=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var n,o,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(n=t?i:r){if(n.has(e))return n.get(e);n.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?n(s,t,o):s[t]=e[t]);return s})(e,t)}const distLint=()=>(0,_gulp.src)(gulpConfig.get("browser.from")).pipe((0,_standardLint.standardLint)({fix:!0})).pipe((0,_gulp.dest)(gulpConfig.get("dist.to")));exports.distLint=distLint;
|
package/dist/distMinify.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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.distMinify = void 0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap()
|
|
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.distMinify = void 0
|
|
8
|
+
const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
9
|
+
const _minifyFor = require('./partials/minifyFor.js')
|
|
10
|
+
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
11
|
/**
|
|
12
12
|
* Creates minified versions of the dist files.
|
|
13
13
|
* @memberOf module:js-build-tools
|
|
14
14
|
* @returns {*}
|
|
15
|
-
*/
|
|
16
|
-
const distMinify = () => (0, _minifyFor.minifyFor)(gulpConfig.get('browser.from'), gulpConfig.get('dist.to'))
|
|
17
|
-
exports.distMinify = distMinify
|
|
15
|
+
*/
|
|
16
|
+
const distMinify = () => (0, _minifyFor.minifyFor)(gulpConfig.get('browser.from'), gulpConfig.get('dist.to'))
|
|
17
|
+
exports.distMinify = distMinify
|
package/dist/images.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.images = void 0
|
|
7
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.images = void 0
|
|
7
|
+
const _imagesFor = require('./partials/imagesFor.js')
|
|
8
8
|
/**
|
|
9
9
|
* Move and optimize the images into the browser folder using configured settings.
|
|
10
10
|
* @memberOf module:js-build-tools
|
|
11
11
|
* @return {stream.Stream}
|
|
12
|
-
*/
|
|
13
|
-
const images = () => (0, _imagesFor.imagesFor)()
|
|
14
|
-
exports.images = images
|
|
12
|
+
*/
|
|
13
|
+
const images = () => (0, _imagesFor.imagesFor)()
|
|
14
|
+
exports.images = images
|
package/dist/partials/copyFor.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.copyFor = void 0;
|
|
7
|
-
var _gulp = require("gulp");
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.copyFor = void 0;
|
|
7
|
+
var _gulp = require("gulp");
|
|
8
8
|
/**
|
|
9
9
|
* Copy some files to a different location.
|
|
10
10
|
* @memberOf module:partials
|
|
11
11
|
* @param {string|array} srcPath
|
|
12
12
|
* @param {string} destPath
|
|
13
13
|
* @returns {stream.Stream}
|
|
14
|
-
*/
|
|
15
|
-
|
|
14
|
+
*/
|
|
15
|
+
// encoding: false copies the bytes untouched - Gulp 5's default utf8 handling corrupts binary files such as fonts.
|
|
16
|
+
const copyFor = (srcPath, destPath) => (0, _gulp.src)(srcPath, {
|
|
17
|
+
encoding: false
|
|
18
|
+
}).pipe((0, _gulp.dest)(destPath));
|
|
16
19
|
exports.copyFor = copyFor;
|
|
@@ -1,28 +1,63 @@
|
|
|
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.imagesFor = void 0;
|
|
8
|
-
var _gulpCache = _interopRequireDefault(require("gulp-cache"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
function
|
|
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 _nodeModule = require("node:module");
|
|
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
|
+
/**
|
|
18
|
+
* Load `gulp-imagemin`, an optional peer dependency: image optimization is off by default and its binary-download
|
|
19
|
+
* dependency chain is heavy, so it is only required once the images task actually runs, and it is resolved from the
|
|
20
|
+
* consuming project's own directory rather than from this package.
|
|
21
|
+
* @memberOf module:partials
|
|
22
|
+
* @param {string} [projectPath=process.cwd()] - The project directory to resolve `gulp-imagemin` from.
|
|
23
|
+
* @returns {Function} The gulp-imagemin plugin factory.
|
|
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
|
+
let loaded;
|
|
28
|
+
try {
|
|
29
|
+
loaded = (0, _nodeModule.createRequire)(_nodePath.default.join(projectPath, 'package.json'))('gulp-imagemin');
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (error.code === 'MODULE_NOT_FOUND' && /Cannot find module 'gulp-imagemin'/.test(error.message)) {
|
|
32
|
+
throw new Error(`The images task needs the optional peer dependency gulp-imagemin, which is not installed. ${installHint}`);
|
|
33
|
+
}
|
|
34
|
+
if (error.code === 'ERR_REQUIRE_ESM') {
|
|
35
|
+
throw new Error(`gulp-imagemin could not be loaded because it is ESM-only. ${installHint}`);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
return loaded && (loaded.__esModule || loaded.default) ? loaded.default : loaded;
|
|
40
|
+
};
|
|
41
|
+
|
|
14
42
|
/**
|
|
15
43
|
* Move and optimize images into the browser directory.
|
|
16
44
|
* @memberOf module:partials
|
|
17
45
|
* @param {string|array} [imageSrc=src/images/pattern]
|
|
18
46
|
* @param {string} [imageDest=dest/image/folder]
|
|
19
47
|
* @return {stream.Stream}
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
48
|
+
*/
|
|
49
|
+
exports.loadImagemin = loadImagemin;
|
|
50
|
+
const imagesFor = (imageSrc = gulpConfig.get('images.from'), imageDest = gulpConfig.get('images.to')) => {
|
|
51
|
+
const imagemin = loadImagemin();
|
|
52
|
+
// Gulp 5 reads files as utf8 text unless told otherwise, which corrupts binary images (and makes gulp-cache drop them).
|
|
53
|
+
return (0, _gulp.src)(imageSrc, {
|
|
54
|
+
encoding: false
|
|
55
|
+
}).pipe(
|
|
56
|
+
// Caching images that ran through imagemin
|
|
57
|
+
(0, _gulpCache.default)(imagemin({
|
|
58
|
+
interlaced: true,
|
|
59
|
+
silent: true,
|
|
60
|
+
verbose: false
|
|
61
|
+
}))).pipe((0, _gulp.dest)(imageDest));
|
|
62
|
+
};
|
|
28
63
|
exports.imagesFor = imagesFor;
|