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 +3 -1
- package/package.json +1 -1
- package/transform/builder-vars.mjs +3 -2
package/core/watcher.mjs
CHANGED
|
@@ -185,7 +185,9 @@ class FileWatcher {
|
|
|
185
185
|
|
|
186
186
|
const handleSvgChange = async path => {
|
|
187
187
|
// .svgファイルのみ処理(iconsディレクトリは除外)
|
|
188
|
-
|
|
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
|
@@ -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
|
|
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 =
|
|
9
|
+
let autoPageUrl = normalizedPath
|
|
9
10
|
|
|
10
11
|
if (autoPageUrl.endsWith('index.pug')) {
|
|
11
12
|
autoPageUrl = autoPageUrl.replace(/index\.pug$/, '')
|