mirror of
https://github.com/knex/knex.git
synced 2025-06-26 22:00:25 +00:00

* WIP changes * Use Babel 7 * Fix build * Fix Node 6 compatibility (apparently Babel has no idea how to transform Object.values) * Try ignoring "expected behaviour" error (https://github.com/babel/babel-loader/issues/152) * Coverage dropped since less code gets generated now, time to revisit threshold
23 lines
480 B
JavaScript
23 lines
480 B
JavaScript
'use strict';
|
|
|
|
const isDev = process.env.npm_lifecycle_event === 'dev';
|
|
|
|
module.exports = function(api) {
|
|
const presets = [
|
|
[
|
|
'@babel/preset-env',
|
|
Object.assign(
|
|
{},
|
|
isDev ? { targets: { node: 'current' } } : { targets: { node: 6 } }
|
|
),
|
|
],
|
|
];
|
|
const plugins = ['add-module-exports'];
|
|
|
|
api.cache(() => process.env.NODE_ENV); // Invalidate cache when building for a different environment
|
|
return {
|
|
presets,
|
|
plugins,
|
|
};
|
|
};
|