8e79f1cb27
* improve Tree Shaking in ESM Instead of bundling everything into a single ESM file, we generate every single file as ESM. This is what we did in 1.4.x as well. I would expect if your library had a single ESM file and you only used 1 function that the application you use it in correctly does the tree-shakign for you. Apparantly a lot of applications are not properly setup for this, so let's create multiple files instead. * update changelog
33 lines
679 B
JavaScript
Executable File
33 lines
679 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
let fastGlob = require('fast-glob')
|
|
|
|
let parts = process.argv.slice(2)
|
|
let [args, flags] = parts.reduce(
|
|
([args, flags], part) => {
|
|
if (part.startsWith('--')) {
|
|
flags[part.slice(2, part.indexOf('='))] = part.slice(part.indexOf('=') + 1)
|
|
} else {
|
|
args.push(part)
|
|
}
|
|
return [args, flags]
|
|
},
|
|
[[], {}]
|
|
)
|
|
|
|
flags.ignore = flags.ignore ?? ''
|
|
flags.ignore = flags.ignore.split(',').filter(Boolean)
|
|
|
|
console.log(
|
|
fastGlob
|
|
.sync(args.join(''))
|
|
.filter((file) => {
|
|
for (let ignore of flags.ignore) {
|
|
if (file.includes(ignore)) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
})
|
|
.join('\n')
|
|
)
|