isaacs / minimatch

a glob matcher in javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support browser and cdn

hans000 opened this issue · comments

output umd mode's file by the packing tool, like rollup.

https://rollupjs.org/guide/en/

why use umd? ESM is the new standard. it can be lazy imported and works basically everywhere nowdays

@hans000 Why close this? I think this issue is still relevant and just use esm as the output for rollup config.

Yeh, I think this is still an issue. If I try to import esm on web, I get error:

import m from 'https://www.unpkg.com/minimatch@6.1.5/dist/mjs/index.js'

Uncaught TypeError: Failed to resolve module specifier "brace-expansion". Relative references must start with either "/", "./", or "../".

brace-expansion is a commonjs module, so it either needs to be bundled, or they need to release an esm version for this to be usable on the web.