pugkit 1.0.0-beta.1 → 1.0.0-beta.2

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/core/watcher.mjs CHANGED
@@ -185,7 +185,9 @@ class FileWatcher {
185
185
 
186
186
  const handleSvgChange = async path => {
187
187
  // .svgファイルのみ処理(iconsディレクトリは除外)
188
- if (!path.endsWith('.svg') || path.includes('/icons/')) {
188
+ // Windows対応: パスセパレータを正規化
189
+ const normalizedPath = path.replace(/\\/g, '/')
190
+ if (!path.endsWith('.svg') || normalizedPath.includes('/icons/')) {
189
191
  return
190
192
  }
191
193
  const relPath = relative(basePath, path)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pugkit",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "A build tool for Pug-based projects",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -2,10 +2,11 @@ import { relative } from 'node:path'
2
2
 
3
3
  export function createBuilderVars(filePath, paths, config) {
4
4
  const relativePath = relative(paths.src, filePath)
5
- const depth = relativePath.split('/').length - 1
5
+ const normalizedPath = relativePath.replace(/\\/g, '/')
6
+ const depth = normalizedPath.split('/').length - 1
6
7
  const autoDir = depth === 0 ? './' : '../'.repeat(depth)
7
8
 
8
- let autoPageUrl = relativePath.replace(/\\/g, '/')
9
+ let autoPageUrl = normalizedPath
9
10
 
10
11
  if (autoPageUrl.endsWith('index.pug')) {
11
12
  autoPageUrl = autoPageUrl.replace(/index\.pug$/, '')