esm-styles 0.3.3 → 0.3.4

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/watch.js +6 -1
  2. package/package.json +1 -1
package/dist/watch.js CHANGED
@@ -2,6 +2,9 @@
2
2
  import { spawn } from 'child_process';
3
3
  import path from 'path';
4
4
  import process from 'process';
5
+ import { fileURLToPath } from 'url';
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
5
8
  const configPath = process.argv[2] || 'esm-styles.config.js';
6
9
  const configModule = await import(path.isAbsolute(configPath)
7
10
  ? configPath
@@ -9,6 +12,8 @@ const configModule = await import(path.isAbsolute(configPath)
9
12
  const config = configModule.default;
10
13
  const basePath = path.resolve(process.cwd(), config.basePath || '.');
11
14
  const sourcePath = path.join(basePath, config.sourcePath || '');
15
+ // Use absolute path to build.js from the esm-styles package
16
+ const buildJsPath = path.join(__dirname, 'build.js');
12
17
  const nodemonArgs = [
13
18
  '--watch',
14
19
  sourcePath,
@@ -17,7 +22,7 @@ const nodemonArgs = [
17
22
  '--ignore',
18
23
  path.join(sourcePath, '$*.mjs'),
19
24
  '--exec',
20
- `node dist/build.js ${configPath}`,
25
+ `node ${buildJsPath} ${configPath}`,
21
26
  ];
22
27
  console.log('[esm-styles] Running:', 'nodemon', ...nodemonArgs);
23
28
  const nodemon = spawn('nodemon', nodemonArgs, { stdio: 'inherit' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esm-styles",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "A library for working with ESM styles",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",