Skip to content

Commit

Permalink
feat: add process.argv to bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
ChALkeR committed Nov 9, 2024
1 parent 100389f commit 98815b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bundler/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ export const build = async (...files) => {
util: dirname(resolveRequire('util/')),
zlib: resolveRequire('browserify-zlib'),
}

const defines = {}
if (files.length === 1) defines['process.argv'] = stringify(['exodus-test', resolve(files[0])])

const res = await buildWrap({
logLevel: 'silent',
stdin: {
Expand All @@ -202,6 +206,7 @@ export const build = async (...files) => {
platform: 'neutral',
mainFields: ['browser', 'module', 'main'],
define: {
...defines,
'process.env.FORCE_COLOR': stringify('0'),
'process.env.NO_COLOR': stringify('1'),
'process.env.NODE_ENV': stringify(process.env.NODE_ENV),
Expand Down

0 comments on commit 98815b9

Please sign in to comment.