Skip to content

Commit

Permalink
fix: #167 support window path with \\ (#168)
Browse files Browse the repository at this point in the history
* fix: #167 support window path with \\

* docs(changeset): support window path with \\

---------

Co-authored-by: liuyi <[email protected]>
  • Loading branch information
liuxy0551 and liuxy0551 authored Oct 9, 2024
1 parent df0754e commit a7956c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-rings-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ko': patch
---

support window path with \\
4 changes: 2 additions & 2 deletions packages/ko/src/webpack/loaders/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Script {
test: /\.worker.[jt]s$/,
loader: this.WORKER_LOADER,
include: (input: string) =>
input.includes('dt-react-monaco-editor/lib/languages'),
/dt-react-monaco-editor[\\/]lib[\\/]languages/.test(input),
options: {
inline: 'fallback',
},
Expand All @@ -26,7 +26,7 @@ class Script {
test: /\.m?(t|j)sx?$/,
include: (input: string) => {
// internal modules dt-common compatible
if (input.includes('node_modules/dt-common/src/')) {
if (/node_modules[\\/]dt-common[\\/]src[\\/]/.test(input)) {
return true;
} else if (input.includes('antlr4-c3')) {
return true;
Expand Down

0 comments on commit a7956c1

Please sign in to comment.