mirror of
https://github.com/knex/knex.git
synced 2025-06-26 22:00:25 +00:00
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,
|
||
|
};
|
||
|
};
|