Skip to content

Commit

Permalink
Merge pull request #3862 from sveltejs/gh-3846-windows-fix
Browse files Browse the repository at this point in the history
encode parts of filename, not entire string
  • Loading branch information
Rich-Harris committed Nov 6, 2019
2 parents b250729 + 07e85c2 commit deb5b68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/compile/utils/get_name_from_filename.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function get_name_from_filename(filename: string) {
if (!filename) return null;
// eslint-disable-next-line no-useless-escape
const parts = encodeURI(filename).split(/[\/\\]/);

const parts = filename.split(/[/\\]/).map(encodeURI);

if (parts.length > 1) {
const index_match = parts[parts.length - 1].match(/^index(\.\w+)/);
Expand Down

0 comments on commit deb5b68

Please sign in to comment.