@eyeglass/cli 0.1.8 → 0.2.0

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -540,8 +540,8 @@ function setupVite(configFile, dryRun) {
540
540
  log('Inspector already imported', 'success');
541
541
  return true;
542
542
  }
543
- // Add import at the top
544
- const importStatement = `import '@eyeglass/inspector';\n`;
543
+ // Add dynamic import at the top (tree-shakeable in production)
544
+ const importStatement = `if (process.env.NODE_ENV !== 'production') {\n import('@eyeglass/inspector');\n}\n`;
545
545
  const newContent = importStatement + content;
546
546
  if (dryRun) {
547
547
  log(`Would add inspector import to ${path.relative(cwd, entryFile)}`);
@@ -675,8 +675,8 @@ function setupNextPagesRouter(cwd, dryRun) {
675
675
  log('Inspector already imported in ' + path.basename(targetFile), 'success');
676
676
  return true;
677
677
  }
678
- // Add import at the top
679
- const importStatement = `import '@eyeglass/inspector';\n`;
678
+ // Add dynamic import at the top (tree-shakeable in production)
679
+ const importStatement = `if (process.env.NODE_ENV !== 'production') {\n import('@eyeglass/inspector');\n}\n`;
680
680
  const newContent = importStatement + fileContent;
681
681
  if (dryRun) {
682
682
  log(`Would add inspector import to ${path.relative(cwd, targetFile)}`);
@@ -718,8 +718,8 @@ function setupCRA(entryFile, dryRun) {
718
718
  log('Inspector already imported', 'success');
719
719
  return true;
720
720
  }
721
- // Add import at the top
722
- const importStatement = `import '@eyeglass/inspector';\n`;
721
+ // Add dynamic import at the top (tree-shakeable in production)
722
+ const importStatement = `if (process.env.NODE_ENV !== 'production') {\n import('@eyeglass/inspector');\n}\n`;
723
723
  const newContent = importStatement + content;
724
724
  if (dryRun) {
725
725
  log(`Would add inspector import to ${path.relative(cwd, entryFile)}`);
@@ -810,7 +810,7 @@ async function init(options) {
810
810
  log('Inspector already imported', 'success');
811
811
  }
812
812
  else {
813
- const importStatement = `import '@eyeglass/inspector';\n`;
813
+ const importStatement = `if (process.env.NODE_ENV !== 'production') {\n import('@eyeglass/inspector');\n}\n`;
814
814
  const newContent = importStatement + content;
815
815
  if (dryRun) {
816
816
  log(`Would add inspector import to ${path.relative(process.cwd(), entryFromHtml)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyeglass/cli",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "Visual debugging for AI coding agents - CLI",
5
5
  "type": "module",
6
6
  "bin": {