rollup-plugin-esbuild
Advanced tools
Comparing version 4.9.3 to 4.10.0
@@ -11,3 +11,3 @@ import { Plugin } from 'rollup'; | ||
}; | ||
declare const minify: (options?: Options$1) => Plugin; | ||
declare const minify: ({ sourceMap, ...options }?: Options$1) => Plugin; | ||
@@ -40,4 +40,4 @@ declare type OptimizeDepsOptions = { | ||
}; | ||
declare const _default: ({ include, exclude, sourceMap: _sourceMap, optimizeDeps, tsconfig, loaders: _loaders, ...esbuildOptions }?: Options) => Plugin; | ||
declare const _default: ({ include, exclude, sourceMap, optimizeDeps, tsconfig, loaders: _loaders, ...esbuildOptions }?: Options) => Plugin; | ||
export { Options, _default as default, minify }; |
@@ -77,11 +77,26 @@ var __create = Object.create; | ||
}); | ||
var jsxValueMap = { | ||
preserve: { | ||
jsx: "preserve" | ||
}, | ||
react: { | ||
jsx: "transform" | ||
}, | ||
"react-jsx": { | ||
jsx: "automatic" | ||
}, | ||
"react-jsxdev": { | ||
jsx: "automatic", | ||
jsxDev: true | ||
} | ||
}; | ||
var getOptions = async (cwd, tsconfig) => { | ||
const { data, path: path2 } = await joycon.load([tsconfig || "tsconfig.json"], cwd); | ||
if (path2 && data) { | ||
const { jsxFactory, jsxFragmentFactory, target } = data.compilerOptions || {}; | ||
return { | ||
const { jsxFactory, jsxFragmentFactory, target, jsx } = data.compilerOptions || {}; | ||
return __spreadValues({ | ||
jsxFactory, | ||
jsxFragment: jsxFragmentFactory, | ||
target: target && target.toLowerCase() | ||
}; | ||
}, jsxValueMap[jsx]); | ||
} | ||
@@ -117,3 +132,3 @@ return {}; | ||
var _b = _a, { | ||
sourceMap | ||
sourceMap = true | ||
} = _b, options = __objRest(_b, [ | ||
@@ -128,3 +143,3 @@ "sourceMap" | ||
loader: "js", | ||
sourcemap: sourceMap !== false | ||
sourcemap: sourceMap | ||
}, options)); | ||
@@ -142,11 +157,10 @@ await warn(this, result.warnings); | ||
}; | ||
var minify = (options = {}) => { | ||
let sourceMap = false; | ||
var minify = (_a = {}) => { | ||
var _b = _a, { | ||
sourceMap = true | ||
} = _b, options = __objRest(_b, [ | ||
"sourceMap" | ||
]); | ||
return { | ||
name: "esbuild-minify", | ||
outputOptions({ sourcemap }) { | ||
var _a; | ||
sourceMap = (_a = options.sourceMap) != null ? _a : !!sourcemap; | ||
return null; | ||
}, | ||
renderChunk: getRenderChunk(__spreadProps(__spreadValues({ | ||
@@ -251,3 +265,3 @@ minify: true | ||
exclude, | ||
sourceMap: _sourceMap, | ||
sourceMap = true, | ||
optimizeDeps: optimizeDeps2, | ||
@@ -290,3 +304,2 @@ tsconfig, | ||
let cwd = process.cwd(); | ||
let sourceMap = false; | ||
return { | ||
@@ -300,6 +313,2 @@ name: "esbuild", | ||
}, | ||
outputOptions({ sourcemap }) { | ||
sourceMap = _sourceMap != null ? _sourceMap : !!sourcemap; | ||
return null; | ||
}, | ||
async buildStart() { | ||
@@ -347,2 +356,4 @@ if (!optimizeDeps2 || optimizeDepsResult) | ||
jsxFragment: defaultOptions.jsxFragment, | ||
jsx: defaultOptions.jsx, | ||
jsxDev: defaultOptions.jsxDev, | ||
sourcemap: sourceMap, | ||
@@ -349,0 +360,0 @@ sourcefile: id |
{ | ||
"name": "rollup-plugin-esbuild", | ||
"version": "4.9.3", | ||
"version": "4.10.0", | ||
"main": "dist/index.js", | ||
@@ -30,3 +30,3 @@ "module": "dist/index.mjs", | ||
"@types/node": "14.14.37", | ||
"esbuild": "^0.14.8", | ||
"esbuild": "^0.14.51", | ||
"istextorbinary": "^6.0.0", | ||
@@ -33,0 +33,0 @@ "jest": "^27.3.1", |
@@ -30,3 +30,3 @@ **💛 You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).** | ||
exclude: /node_modules/, // default | ||
sourceMap: false, // by default inferred from rollup's `output.sourcemap` option | ||
sourceMap: true, // default | ||
minify: process.env.NODE_ENV === 'production', | ||
@@ -33,0 +33,0 @@ target: 'es2017', // default, or 'es20XX', 'esnext' |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29758
738