esm-styles 0.3.2 → 0.3.3

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/watch.js ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'child_process';
3
+ import path from 'path';
4
+ import process from 'process';
5
+ const configPath = process.argv[2] || 'esm-styles.config.js';
6
+ const configModule = await import(path.isAbsolute(configPath)
7
+ ? configPath
8
+ : path.resolve(process.cwd(), configPath));
9
+ const config = configModule.default;
10
+ const basePath = path.resolve(process.cwd(), config.basePath || '.');
11
+ const sourcePath = path.join(basePath, config.sourcePath || '');
12
+ const nodemonArgs = [
13
+ '--watch',
14
+ sourcePath,
15
+ '--ext',
16
+ 'mjs',
17
+ '--ignore',
18
+ path.join(sourcePath, '$*.mjs'),
19
+ '--exec',
20
+ `node dist/build.js ${configPath}`,
21
+ ];
22
+ console.log('[esm-styles] Running:', 'nodemon', ...nodemonArgs);
23
+ const nodemon = spawn('nodemon', nodemonArgs, { stdio: 'inherit' });
24
+ nodemon.on('exit', (code) => process.exit(code));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esm-styles",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "A library for working with ESM styles",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",