-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve Dependency correctly if the target asset is URI-encoded (#401)
* Resolve Dependency correctly if the target asset is URI-encoded * Resolve Dependency correctly if the target asset is URI-encoded * revert decodeURIComponent * Resolve Dependency correctry if the target asset is URI-encoded * add a test code
- Loading branch information
1 parent
4e2ecc3
commit 9770acf
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
const {bundle, assertBundleTree} = require('./utils'); | ||
|
||
describe('encodedURI', function() { | ||
it('should support bundling files which names in encoded URI', async function() { | ||
let b = await bundle(__dirname + '/integration/encodedURI/index.html'); | ||
|
||
assertBundleTree(b, { | ||
name: 'index.html', | ||
assets: ['index.html'], | ||
childBundles: [ | ||
{ | ||
type: 'jpg', | ||
assets: ['日本語.jpg'], | ||
childBundles: [] | ||
} | ||
] | ||
}); | ||
|
||
let files = fs.readdirSync(__dirname + '/dist'); | ||
let html = fs.readFileSync(__dirname + '/dist/index.html'); | ||
for (let file of files) { | ||
if (file !== 'index.html') { | ||
assert(html.includes(file)); | ||
} | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Parcel encoded-URI testing</title> | ||
</head> | ||
<body> | ||
<H1>Parcel encoded-URI testing</H1> | ||
<img alt="日本語" src="%e6%97%a5%e6%9c%ac%e8%aa%9e.jpg" /> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.