Skip to content

Commit

Permalink
[lexical-eslint-plugin] Fix: Use cjs compatible export from built ver…
Browse files Browse the repository at this point in the history
…sion (#6252)
  • Loading branch information
etrepum authored Jun 4, 2024
1 parent c125329 commit 2605b8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,14 @@ async function build(name, inputFile, outputPath, outputFile, isProd, format) {
// This ensures PrismJS imports get included in the bundle
treeshake: name !== 'Lexical Code' ? 'smallest' : false,
};
/** @type {import('rollup').OutputOptions} */
const outputOptions = {
esModule: false,
exports: 'named',
exports:
// Special case for lexical-eslint-plugin which is written in cjs and
// requires a default export. Default exports in all other modules are
// deprecated.
name === 'Lexical Eslint Plugin' ? 'auto' : 'named',
externalLiveBindings: false,
file: outputFile,
format, // change between es and cjs modules
Expand Down

0 comments on commit 2605b8b

Please sign in to comment.