mirror of
https://github.com/hanzoai/workbox.git
synced 2026-09-24 17:04:35 +00:00
* The contents of v3, reconciled with master. * Remove a few stray files. * Another extra file. * Two more deletions. * Setting up for stable release * v3.0.0 * Updating CDN and versions * Doc repair for wf (#1358) * Changing doc structure to work with WF * Changing doc structure to work with WF
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
const babel = require('gulp-babel');
|
|
const gulp = require('gulp');
|
|
const oneLine = require('common-tags').oneLine;
|
|
const path = require('path');
|
|
|
|
const constants = require('./constants');
|
|
const logHelper = require('../../infra/utils/log-helper');
|
|
const pkgPathToName = require('./pkg-path-to-name');
|
|
|
|
module.exports = (packagePath) => {
|
|
const packageName = pkgPathToName(packagePath);
|
|
const outputDirectory = path.join(packagePath,
|
|
constants.PACKAGE_BUILD_DIRNAME);
|
|
|
|
logHelper.log(oneLine`
|
|
Building Node Package for
|
|
${logHelper.highlight(packageName)}.
|
|
`);
|
|
|
|
return gulp.src(`${packagePath}/src/**`).pipe(babel({
|
|
only: /\.js$/,
|
|
presets: [
|
|
['env', {
|
|
targets: {
|
|
// Change this when our minimum required node version changes.
|
|
node: '4.0',
|
|
},
|
|
}],
|
|
],
|
|
plugins: [
|
|
// This ensures that the helpers used by Babel to accompany transpilation
|
|
// are only included in our Rollup bundles once, even if they're used
|
|
// in multiple source files.
|
|
// See https://github.com/rollup/rollup-plugin-babel#helpers
|
|
'transform-runtime',
|
|
],
|
|
})).pipe(gulp.dest(outputDirectory));
|
|
};
|