diff --git a/lib/args.js b/lib/args.js index 35f0e83..ac5388c 100644 --- a/lib/args.js +++ b/lib/args.js @@ -1,4 +1,5 @@ import yargs from 'yargs' +import fs from 'fs-extra' const { argv } = yargs(process.argv.slice(2)) .usage( @@ -94,6 +95,11 @@ const { argv } = yargs(process.argv.slice(2)) type: 'string', }) .alias('h', 'help') + // HACK: Workaround for https://github.com/yargs/yargs/issues/1934 + .version( + fs.readJSONSync(new URL('../package.json', import.meta.url).pathname) + .version + ) .example('$0 input.css -o output.css', 'Basic usage') .example('$0 src/**/*.css --base src --dir build', 'Glob Pattern & output') .example(