Skip to content
This repository has been archived by the owner on Mar 27, 2018. It is now read-only.

Commit

Permalink
fix(build): only remove babel-runtime alias from next/babel, not all …
Browse files Browse the repository at this point in the history
…aliases
  • Loading branch information
Ian Wensink committed Sep 14, 2017
1 parent 55d15cc commit 4e6a96d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ const babelModuleResolverIndex = plugins.findIndex((plugin) => {
return false;
});

// Remove babel-module-resolver because Next uses his local babel-runtime, but we need it to grab just the one that's available.
plugins.splice(babelModuleResolverIndex, 1);
const babelModuleResolver = plugins[babelModuleResolverIndex];

const babelModulesResolverAlias = {...[...babelModuleResolver][1].alias};

// Remove babel-runtime alias because Next uses his local babel-runtime, but we need it to grab just the one that's available.
delete babelModulesResolverAlias['babel-runtime'];

babelModuleResolver[1].alias = babelModulesResolverAlias;

plugins[babelModuleResolverIndex] = babelModuleResolver;

babelCopy.plugins = plugins;

Expand Down

0 comments on commit 4e6a96d

Please sign in to comment.