mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
19 lines
335 B
JavaScript
19 lines
335 B
JavaScript
function isBabelLoader (caller) {
|
|
return caller && caller.name === 'babel-loader'
|
|
}
|
|
|
|
module.exports = function (api) {
|
|
if (api.env('test') && !api.caller(isBabelLoader)) {
|
|
return {
|
|
presets: [
|
|
['@babel/env', {
|
|
targets: {
|
|
node: 'current'
|
|
}
|
|
}]
|
|
]
|
|
}
|
|
}
|
|
return {}
|
|
}
|