UNPKG

@area17/a17-boilerplate

Version:

The official AREA 17 boilerplate

30 lines (22 loc) 1.06 kB
const utils = require('../utils'); const chalk = require('chalk'); const data = utils.getManifest(); const createLogger = require('logging').default; const logger = createLogger('Revision'); const argv = require('minimist')(process.argv.slice(2)); const nodeRev = require('node-rev').default; const customFiles = data.revAssets || []; const defaultFiles = [ `${data.paths.dist}**/*.css`, `${data.paths.dist}**/*.js`, ]; const files = defaultFiles.concat(customFiles).join(','); const options = { files: files, //glob to files you want in the manifest outputDir: data.paths.dist,//where you want the files to be output that are part of the manifest file: data.paths.dist + 'rev-manifest.json',//optional, allows you to specify location of manifest file and name it, default is root of the project hash: argv.production //if you are in dev mode, you can set this to false to just have it create the manifest with the same filenames }; logger.info('Starting Assets revision'); nodeRev(options); logger.info(chalk.green('Succeed Assets revision'));