vite-plugin-esmodule
Advanced tools
Comparing version 1.1.1 to 1.1.2
16
index.js
@@ -15,7 +15,13 @@ const fs = require('fs'); | ||
const plugin = optimizer( | ||
modules.reduce((memo, mod, idx) => Object.assign(memo, { | ||
[mod]: args => idx === modules.length - 1 | ||
? buildESModules(args, modules, options) // One time build | ||
: null, | ||
}), {}), | ||
modules.reduce((memo, mod, idx) => { | ||
if (typeof mod === 'object') { | ||
// e.g. { 'file-type': 'file-type/index.js' } | ||
mod = Object.keys(mod)[0]; | ||
} | ||
return Object.assign(memo, { | ||
[mod]: args => idx === modules.length - 1 | ||
? buildESModules(args, modules, options) // One time build | ||
: null, | ||
}) | ||
}, {}), | ||
{ dir: `.${name}` }, | ||
@@ -22,0 +28,0 @@ ); |
{ | ||
"name": "vite-plugin-esmodule", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Build ES module to CommonJs module for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
9120
178