From 5d53e9248bc67a02cb8f9d907e5c0dc93c0ef605 Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" Date: Sat, 22 Feb 2020 20:31:16 -0800 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20need=20this?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulp/index.js | 4 --- gulp/rollup.js | 72 -------------------------------------------------- 2 files changed, 76 deletions(-) delete mode 100644 gulp/rollup.js diff --git a/gulp/index.js b/gulp/index.js index f4f3b22..b695d48 100644 --- a/gulp/index.js +++ b/gulp/index.js @@ -25,10 +25,6 @@ exports.scss = scssTask; var jsTask = require('./scripts'); exports.js = jsTask; -var jsRollupTask = require('./rollup'); -exports.jsr = jsRollupTask; - - var cleanTask = require('./clean'); exports.clean = cleanTask; diff --git a/gulp/rollup.js b/gulp/rollup.js deleted file mode 100644 index 69be06f..0000000 --- a/gulp/rollup.js +++ /dev/null @@ -1,72 +0,0 @@ - -const path = require('path'); -const { src, dest } = require('gulp'); -const rollup = require('gulp-better-rollup'); -const { string } = require('rollup-plugin-string'); -const resolveNodeModules = require('rollup-plugin-node-resolve'); -const commonJs = require('rollup-plugin-commonjs'); -const json = require('rollup-plugin-json'); -// const alias = require('rollup-plugin-alias'); - -const minify = require('gulp-minify'); -const rev = require('gulp-rev'); -const asyncthrough = require('./lib/through'); - - -const ROOT = path.dirname(__dirname); -const DEST = 'dist/js'; - -function rollupPipe () { - return src('js-rollup/*.js') - .pipe(rollup({ - // There is no `input` option as rollup integrates into the gulp pipeline - plugins: [ - string({ - include: '**/*.html', - }), - resolveNodeModules(), - commonJs(), - json(), - ], - external: [ 'jquery', 'lodash', 'underscore' ], - }, { - // Rollups `sourcemap` option is unsupported. Use `gulp-sourcemaps` plugin instead - format: 'iife', - globals: { - jquery: '$', - lodash: '_', - backbone: 'Backbone', - underscore: '_', - }, - })); -}; - -module.exports = exports = function rollupJS () { - return rollupPipe() - .pipe(dest(DEST)); -}; - -exports.prod = function rollupJSForProd () { - return rollupPipe() - .pipe(minify({ - ext: { min: '.js' }, - noSource: true, - })) - .pipe(dest(DEST)) - .pipe(rev()) - .pipe(dest(DEST)) - .pipe(asyncthrough(async (stream, file) => { - // Change rev's original base path back to the public root so that it uses the full - // path as the original file name key in the manifest - var base = path.resolve(ROOT, 'dist'); - file.revOrigBase = base; - file.base = base; - - stream.push(file); - })) - .pipe(rev.manifest({ - merge: true, // Merge with the existing manifest if one exists - })) - .pipe(dest('.')) - ; -};