mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-14 22:00:34 +00:00
minimatch 3.x uses `try { return require('path') } catch (e) {}` to
get the path module, falling back to `{ sep: '/' }`. With rollup's
commonjs plugin, `ignoreTryCatch: true` (the default) leaves
require('path') unconverted inside try blocks. At runtime in the ESM
bundle, require() is unavailable, so the catch fires and minimatch
uses '/' as the path separator — breaking all glob matching on Windows
where paths use backslashes.
Setting ignoreTryCatch: false ensures require('path') is converted to
an ESM import, giving minimatch the correct path.sep ('\\' on Windows).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
491 B
TypeScript
22 lines
491 B
TypeScript
import commonjs from '@rollup/plugin-commonjs'
|
|
import json from '@rollup/plugin-json'
|
|
import nodeResolve from '@rollup/plugin-node-resolve'
|
|
import typescript from '@rollup/plugin-typescript'
|
|
|
|
const config = {
|
|
input: 'src/index.ts',
|
|
output: {
|
|
esModule: true,
|
|
file: 'dist/index.js',
|
|
format: 'es',
|
|
sourcemap: true
|
|
},
|
|
plugins: [
|
|
typescript(),
|
|
nodeResolve({ preferBuiltins: true }),
|
|
commonjs({ ignoreTryCatch: false }),
|
|
json()
|
|
]
|
|
}
|
|
|
|
export default config
|