tailwind-hyperclay 0.1.6 → 0.1.9

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/index.js +5 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const { readFile, writeFile } = require('fs/promises');
2
2
  const path = require('path');
3
+ const { compile } = require('tailwindcss');
3
4
 
4
5
  async function generateCSS({ input, output }) {
5
6
  const html = await readFile(input, 'utf-8');
@@ -14,7 +15,6 @@ async function generateCSS({ input, output }) {
14
15
  }
15
16
 
16
17
  async function compileTailwind(html) {
17
- const { compile } = await import('tailwindcss');
18
18
 
19
19
  const inputCSS = `
20
20
  @import "tailwindcss";
@@ -48,16 +48,14 @@ async function compileTailwind(html) {
48
48
  return { content, base: path.dirname(resolved) };
49
49
  },
50
50
  loadModule: async (id, base) => {
51
- const { pathToFileURL } = await import('url');
52
51
  const resolved = require.resolve(id, { paths: [base || process.cwd()] });
53
- const mod = await import(pathToFileURL(resolved).href);
54
- return { module: mod.default, base: path.dirname(resolved) };
52
+ const mod = require(resolved);
53
+ return { module: mod.default || mod, base: path.dirname(resolved) };
55
54
  },
56
55
  loadPlugin: async (plugin) => {
57
- const { pathToFileURL } = await import('url');
58
56
  const resolved = require.resolve(plugin);
59
- const mod = await import(pathToFileURL(resolved).href);
60
- return mod.default;
57
+ const mod = require(resolved);
58
+ return mod.default || mod;
61
59
  }
62
60
  });
63
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-hyperclay",
3
- "version": "0.1.6",
3
+ "version": "0.1.9",
4
4
  "description": "On-save Tailwind CSS generator for Hyperclay",
5
5
  "main": "index.js",
6
6
  "scripts": {