| 189 | // TODO(addaleax): Make this `embedderRunCjs` once require('module') |
| 190 | // is supported in snapshots. |
| 191 | function minimalRunCjs(source) { |
| 192 | let filename; |
| 193 | let dirname; |
| 194 | if (process.argv[1] === anonymousMainPath) { |
| 195 | filename = dirname = process.argv[1]; |
| 196 | } else { |
| 197 | filename = path.resolve(process.argv[1]); |
| 198 | dirname = path.dirname(filename); |
| 199 | } |
| 200 | |
| 201 | const fn = compileSerializeMain(filename, source); |
| 202 | return fn(requireForUserSnapshot, filename, dirname); |
| 203 | } |
| 204 | |
| 205 | if (isExperimentalSeaWarningNeeded()) { |
| 206 | emitExperimentalWarning('Single executable application'); |