Skip to content

Commit

Permalink
fix(babel-preset): add missing ignored script
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored and Raphaël Benitte committed Dec 5, 2017
1 parent 8f509fd commit 17ac44e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nivo-babel-preset/index.js
Expand Up @@ -60,7 +60,7 @@ if (env === 'commonjs') {
}

if (env === 'es') {
plugins.push.apply(plugins, [require.resolve('./build/use-lodash-es')])
plugins.push.apply(plugins, [require.resolve('./use-lodash-es')])
}

if (env === 'test') {
Expand Down
13 changes: 13 additions & 0 deletions packages/nivo-babel-preset/use-lodash-es.js
@@ -0,0 +1,13 @@
module.exports = function() {
return {
visitor: {
ImportDeclaration(path) {
var source = path.node.source
source.value = source.value.replace(
/^lodash($|\/)/,
'lodash-es$1'
)
},
},
}
}

0 comments on commit 17ac44e

Please sign in to comment.