pika-plugin-build-web-babel
Advanced tools
Comparing version 0.7.9 to 0.7.10
{ | ||
"name": "pika-plugin-build-web-babel", | ||
"description": "A @pika/pack plugin: Adds an babel compiled ESM distribution to your package", | ||
"version": "0.7.9", | ||
"version": "0.7.10", | ||
"files": [ | ||
@@ -6,0 +6,0 @@ "src/" |
@@ -15,6 +15,9 @@ var path = (require('path')); | ||
const defaultFormat = 'esm'; | ||
const dirMap = { | ||
cjs: 'dist-node', | ||
esm: 'dist-web', | ||
} | ||
function manifest(manifest, { options }) { | ||
const format = options.format || defaultFormat; | ||
const dist = `${format}/index.js`; | ||
const dist = `${dirMap[format]}/index.js`; | ||
const field = format === 'esm' ? 'module' : 'main'; | ||
@@ -33,3 +36,3 @@ manifest[field] = manifest[field] || dist; | ||
const format = options.format || defaultFormat; | ||
const dist = `${format}/index.js`; | ||
const dist = `${dirMap[format]}/index.js`; | ||
const writeToWeb = path.join(out, dist); | ||
@@ -36,0 +39,0 @@ const extensions = options.extensions || defaultExtensions; |
2904
70