Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

env:
FORCE_COLOR: 2
NODE_DISABLE_COMPILE_CACHE: 1

jobs:
lint:
Expand Down
5 changes: 5 additions & 0 deletions lib/cjs.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const mod = require('node:module')

// to use V8's code cache to speed up instantiation time
mod.enableCompileCache?.()

const { default: npmRunAll } = require('./esm.mjs')

// Didn't manage to get this into the last breaking change, so adding a cjs as the primary export
Expand Down
4 changes: 4 additions & 0 deletions lib/esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// Requirements
// ------------------------------------------------------------------------------

import mod from 'node:module'
import shellQuote from 'shell-quote'
import matchTasks from './match-tasks.js'
import readPackageJson from './read-package-json.js'
Expand All @@ -18,6 +19,9 @@ import runTasks from './run-tasks.js'
// Helpers
// ------------------------------------------------------------------------------

// to use V8's code cache to speed up instantiation time
mod.enableCompileCache?.()

const ARGS_PATTERN = /\{(!)?([*@%]|\d+)([^}]+)?}/g
const ARGS_UNPACK_PATTERN = /\{(!)?([%])([^}]+)?}/g

Expand Down
3 changes: 3 additions & 0 deletions lib/run-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import fs from 'node:fs'
import path from 'node:path'
import mod from 'node:module'

import ansiStyles from 'ansi-styles'
import { parse as parseArgs } from 'shell-quote'
Expand Down Expand Up @@ -208,6 +209,8 @@ export default function runTask (task, options) {
}
Array.prototype.push.apply(spawnArgs, parseArgs(task).map(cleanTaskArg))

mod.flushCompileCache?.()

cp = await spawn(execPath, spawnArgs, spawnOptions)

// Piping stdio.
Expand Down