Skip to content

Commit

Permalink
fix: apply dynamicImportUrlToPath polyfill on publish
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Aug 11, 2020
1 parent 69f548e commit 0e32b25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ module.exports = function (api) {
// the original absolute path.
// NOTE: This plugin must run before @babel/plugin-transform-modules-commonjs,
// and assumes that the target is the current node version.
function dynamicImportUrlToPath({ template }) {
function dynamicImportUrlToPath({ template, env }) {
const currentNodeSupportsURL = !!require("url").pathToFileURL;

if (currentNodeSupportsURL) {
if (currentNodeSupportsURL && env() !== "production") {
return {
visitor: {
CallExpression(path) {
Expand Down

0 comments on commit 0e32b25

Please sign in to comment.