Skip to content

Commit

Permalink
fix: normalize windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
lubomirblazekcz committed Dec 15, 2022
1 parent 3c33dd5 commit 06accef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function processData(paths, data = {}) {

lodash.merge(context, data)

FastGlob.sync(paths).forEach(entry => {
const normalizePaths = Array.isArray(paths) ? paths.map(path => path.replace(/\\/g, '/')) : paths.replace(/\\/g, '/')

FastGlob.sync(normalizePaths).forEach(entry => {
const path = resolve(process.cwd(), entry)

context = lodash.merge(context, JSON.parse(fs.readFileSync(path).toString()))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vituum/vite-plugin-twig",
"version": "0.1.6",
"version": "0.1.7",
"type": "module",
"main": "index.js",
"dependencies": {
Expand Down

0 comments on commit 06accef

Please sign in to comment.