@nasl/cli 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -13401,6 +13401,14 @@ function fastLogToFile(entry, suffix, content) {
13401
13401
  libExports.outputFileSync(filePath, content);
13402
13402
  }
13403
13403
  }
13404
+ function fastAppendLogToFile(suffix, content) {
13405
+ if (process.env.NASL_CLI_LOG_DIR) {
13406
+ const logDir = sysPath.resolve(process.env.NASL_CLI_LOG_DIR);
13407
+ libExports.ensureDirSync(logDir);
13408
+ const filePath = sysPath.resolve(logDir, `-_-${suffix}`);
13409
+ libExports.outputFileSync(filePath, content, { flag: 'a' });
13410
+ }
13411
+ }
13404
13412
  /**
13405
13413
  * 日志工具类
13406
13414
  */
@@ -34491,7 +34499,7 @@ async function dev(entry, options) {
34491
34499
  // 有 src 目录,先进行一次初始编译
34492
34500
  logger.info('检测到 src 目录,开始初始编译...');
34493
34501
  try {
34494
- await compile(entry);
34502
+ await compile(entry, { logger });
34495
34503
  lastCompileSuccess = true;
34496
34504
  logger.success('初始编译成功!');
34497
34505
  }
@@ -34657,10 +34665,11 @@ async function startWebpackDevServer(outDir, options, logger) {
34657
34665
  webpackArgs += ` --port ${options.port}`;
34658
34666
  if (options?.host)
34659
34667
  webpackArgs += ` --host ${options.host}`;
34660
- if (options?.open)
34661
- webpackArgs += ' --open';
34662
- if (options?.hot)
34663
- webpackArgs += ' --hot';
34668
+ if (options?.open === false)
34669
+ webpackArgs += ' --no-open';
34670
+ if (options?.hot === false)
34671
+ webpackArgs += ' --no-hot';
34672
+ logger?.info(webpackArgs);
34664
34673
  // 使用 spawn 而不是 spawnSync,以便进程可以常驻
34665
34674
  const webpackProcess = spawn(webpackArgs, {
34666
34675
  shell: true,
@@ -36363,5 +36372,5 @@ var index$1 = /*#__PURE__*/Object.freeze({
36363
36372
  watch: watch
36364
36373
  });
36365
36374
 
36366
- export { BaseLogger, CONFIG_FILE_NAME, ConsoleLogger, ConsoleLoggerWithoutExit, DEFAULT_CONFIG, MemoryLogger, build, check, compile, composeToString, createSorter, defaultLogger, dep, dev, fastLogToFile, init, resolveNASLFiles, scanEntryFiles, scanNASLFiles, sorter, tryCompile };
36375
+ export { BaseLogger, CONFIG_FILE_NAME, ConsoleLogger, ConsoleLoggerWithoutExit, DEFAULT_CONFIG, MemoryLogger, build, check, compile, composeToString, createSorter, defaultLogger, dep, dev, fastAppendLogToFile, fastLogToFile, init, resolveNASLFiles, scanEntryFiles, scanNASLFiles, sorter, tryCompile };
36367
36376
  //# sourceMappingURL=index.mjs.map