Skip to content

Commit

Permalink
fix: replace backslash with forward slash on windows (#53)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Morawietz <jan.morawietz@paessler.com>
  • Loading branch information
DesselBane and Jan Morawietz committed Jan 16, 2024
1 parent 2b58d5e commit edec675
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
38 changes: 15 additions & 23 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"projectOwner": "OpenSourceRaidGuild",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"files": ["README.md"],
"imageSize": 100,
"commit": false,
"commitConvention": "none",
Expand All @@ -15,57 +13,51 @@
"name": "Michael Peyper",
"avatar_url": "https://avatars.githubusercontent.com/u/23029903?v=4",
"profile": "https://github.com/mpeyper",
"contributions": [
"code",
"test",
"doc"
]
"contributions": ["code", "test", "doc"]
},
{
"login": "nobrayner",
"name": "Braydon Hall",
"avatar_url": "https://avatars.githubusercontent.com/u/40751395?v=4",
"profile": "https://github.com/nobrayner",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "MohitPopli",
"name": "Mohit",
"avatar_url": "https://avatars.githubusercontent.com/u/17976072?v=4",
"profile": "https://github.com/MohitPopli",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "rubenmoya",
"name": "Rubén Moya",
"avatar_url": "https://avatars.githubusercontent.com/u/905225?v=4",
"profile": "https://rubenmoya.dev/",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "mitchelvanbever",
"name": "Mitchel van Bever",
"avatar_url": "https://avatars.githubusercontent.com/u/10127707?v=4",
"profile": "https://github.com/mitchelvanbever",
"contributions": [
"ideas"
]
"contributions": ["ideas"]
},
{
"login": "vctqs1",
"name": "vctqs1",
"avatar_url": "https://avatars.githubusercontent.com/u/30227910?v=4",
"profile": "https://github.com/vctqs1",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "DesselBane",
"name": "DesselBane",
"avatar_url": "https://avatars.githubusercontent.com/u/12199480?v=4",
"profile": "https://github.com/DesselBane",
"contributions": ["code"]
}
],
"contributorsPerLine": 8
}

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="12.5%"><a href="https://github.com/MohitPopli"><img src="https://avatars.githubusercontent.com/u/17976072?v=4?s=100" width="100px;" alt="Mohit"/><br /><sub><b>Mohit</b></sub></a><br /><a href="https://github.com/OpenSourceRaidGuild/babel-vite/commits?author=MohitPopli" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://rubenmoya.dev/"><img src="https://avatars.githubusercontent.com/u/905225?v=4?s=100" width="100px;" alt="Rubén Moya"/><br /><sub><b>Rubén Moya</b></sub></a><br /><a href="https://github.com/OpenSourceRaidGuild/babel-vite/commits?author=rubenmoya" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/mitchelvanbever"><img src="https://avatars.githubusercontent.com/u/10127707?v=4?s=100" width="100px;" alt="Mitchel van Bever"/><br /><sub><b>Mitchel van Bever</b></sub></a><br /><a href="#ideas-mitchelvanbever" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/vctqs1"><img src="https://avatars.githubusercontent.com/u/30227910?v=4?s=100" width="100px;" alt="vctqs1"/><br /><sub><b>vctqs1</b></sub></a><br /><a href="https://github.com/OpenSourceRaidGuild/babel-vite/commits?author=vctqs1" title="Code">💻</a> <a href="https://github.com/OpenSourceRaidGuild/babel-vite/commits?author=vctqs1" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/vctqs1"><img src="https://avatars.githubusercontent.com/u/30227910?v=4?s=100" width="100px;" alt="vctqs1"/><br /><sub><b>vctqs1</b></sub></a><br /><a href="https://github.com/OpenSourceRaidGuild/babel-vite/commits?author=vctqs1" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/DesselBane"><img src="https://avatars.githubusercontent.com/u/12199480?v=4?s=100" width="100px;" alt="DesselBane"/><br /><sub><b>DesselBane</b></sub></a><br /><a href="https://github.com/OpenSourceRaidGuild/babel-vite/commits?author=DesselBane" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
10 changes: 7 additions & 3 deletions packages/babel-plugin-transform-vite-meta-glob/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export default function viteMetaGlobBabelPlugin({
t.isStringLiteral(args[0])
) {
const cwd = nodePath.dirname(sourceFile)
const globPaths = globSync(args[0].value, { cwd, dotRelative: true }).sort()
const globPaths = globSync(args[0].value, { cwd, dotRelative: true })
.sort()
.map((globPath) => globPath.replace(/\\/g, '/'))

const replacement = t.objectExpression(
globPaths.map((globPath) =>
Expand Down Expand Up @@ -85,7 +87,9 @@ export default function viteMetaGlobBabelPlugin({
t.isBooleanLiteral(eagerOption[0].value)
) {
const cwd = nodePath.dirname(sourceFile)
const globPaths = globSync(args[0].value, { cwd, dotRelative: true }).sort()
const globPaths = globSync(args[0].value, { cwd, dotRelative: true })
.sort()
.map((globPath) => globPath.replace(/\\/g, '/'))

if (eagerOption[0].value.value) {
const identifiers = globPaths.map((_, idx) => t.identifier(`__glob__0_${idx}`))
Expand All @@ -97,7 +101,7 @@ export default function viteMetaGlobBabelPlugin({
identifiers[idx],
t.callExpression(t.identifier('require'), [modulePath])
)
]);
])
})

const variable = t.variableDeclaration('const', [
Expand Down

0 comments on commit edec675

Please sign in to comment.