shopify-accelerate-app 1.1.5 → 1.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify-accelerate-app",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Shopify App development with full Typescript Support",
5
5
  "author": "Felix Tellmann",
6
6
  "license": "MIT",
@@ -55,9 +55,10 @@ const generateInputCSS = (base_css_path: string, user_css_path: string): string
55
55
  ].join("\n");
56
56
  }
57
57
 
58
- // Source paths for content detection
59
- const extension_path = process.env.SHOPIFY_ACCELERATE_EXTENSION_PATH ?? "";
60
- const source_directive = extension_path ? `@source "${extension_path}/**/*.{html,liquid,js,json}";` : "";
58
+ // Source paths for content detection — resolve to absolute so they work from the generated file's location
59
+ const extension_path_raw = process.env.SHOPIFY_ACCELERATE_EXTENSION_PATH ?? "";
60
+ const extension_path_abs = extension_path_raw ? path.resolve(root_dir, extension_path_raw).replace(/\\/g, "/") : "";
61
+ const source_directive = extension_path_abs ? `@source "${extension_path_abs}/**/*.{html,liquid,js,json}";` : "";
61
62
 
62
63
  // Safelist equivalent via @source inline()
63
64
  const safelist_prefix = prefix ? `${prefix}:` : "";
@@ -65,11 +66,13 @@ const generateInputCSS = (base_css_path: string, user_css_path: string): string
65
66
  const safelist = `@source inline("${safelist_prefix}inset-0 ${safelist_prefix}pointer-events-none [&>*]:${safelist_prefix}pointer-events-auto");`;
66
67
 
67
68
  // Read the base CSS config (theme, variants, utilities, plugins)
68
- // Resolve bare package imports to absolute paths so they work from the generated file's location
69
+ // Resolve bare package imports and relative paths to absolute so they work from the generated file's location
69
70
  const tw_animate_path = path.join(package_root, "node_modules/tw-animate-css/dist/tw-animate.css").replace(/\\/g, "/");
71
+ const base_css_dir = path.dirname(base_css_path).replace(/\\/g, "/");
70
72
  const base_css = fs
71
73
  .readFileSync(base_css_path, { encoding: "utf-8" })
72
- .replace('@import "tw-animate-css"', `@import "${tw_animate_path}"`);
74
+ .replace('@import "tw-animate-css"', `@import "${tw_animate_path}"`)
75
+ .replace(/@plugin "\.\/([^"]+)"/g, `@plugin "${base_css_dir}/$1"`);
73
76
 
74
77
  // Read the user's _tailwind.css
75
78
  const user_css = fs.readFileSync(user_css_path, { encoding: "utf-8" });