Skip to content

Commit

Permalink
fix: 0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxch committed Jun 21, 2022
1 parent 90b1969 commit 137a251
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Changelog

### 0.4.3

_2022-06-21_
#### Bug fixes

- template strings does not work.([#8](https://github.com/chenxch/vite-plugin-dynamic-base/issues/8))

### 0.4.1

_2022-05-09_
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Changelog

### 0.4.3

_2022-06-21_
#### Bug fixes

- 修复字符串模板不工作.([#8](https://github.com/chenxch/vite-plugin-dynamic-base/issues/8))

### 0.4.1

_2022-05-09_
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ npm i vite-plugin-dynamic-base -D

## Changelog

### 0.4.1
### 0.4.3

_2022-05-09_
_2022-06-21_
#### Bug fixes

- Legacy is invalid in browsers such as IE11.
- template strings does not work.([#8](https://github.com/chenxch/vite-plugin-dynamic-base/issues/8))


[Changelogs](./CHANGELOG.md)
Expand Down
9 changes: 5 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ npm i vite-plugin-dynamic-base -D

## 变更日志

### 0.4.1
### 0.4.3

_2022-05-09_
#### Bug 修复
_2022-06-21_
#### Bug fixes

- 修复字符串模板不工作.([#8](https://github.com/chenxch/vite-plugin-dynamic-base/issues/8))

- IE11 等浏览器下,兼容模式无法加载。

[变更日志](./CHANGELOG.zh-CN.md)

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": "vite-plugin-dynamic-base",
"version": "0.4.2",
"version": "0.4.3",
"description": "Resolve all resource files dynamic publicPath, like Webpack's __webpack_public_path__",
"main": "dist/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export function replaceQuotes(mark: string, placeholder: string, code: string) {
const singlePlaceholder = `${placeholder}+'/`
const doubleMark = `"${mark}`
const doublePlaceholder = `${placeholder}+"/`
return replace(doubleMark, doublePlaceholder, replace(singleMark, singlePlaceholder, code))
const templateMark = `\`${mark}`;
const templatePlaceholder = `\`\$\{${placeholder}\}/`;
return replace(doubleMark, doublePlaceholder, replace(singleMark, singlePlaceholder, replace(templateMark, templatePlaceholder, code)));
}

// replace asset url
Expand Down

0 comments on commit 137a251

Please sign in to comment.