mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-11 14:57:15 +00:00
20 lines
374 B
JavaScript
20 lines
374 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'
|
|
}
|
|
}]
|
|
],
|
|
plugins: ['dynamic-import-node']
|
|
}
|
|
}
|
|
return {}
|
|
}
|