-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added the
postprocessor
option (#518)
- Loading branch information
1 parent
31685f7
commit 536a204
Showing
13 changed files
with
241 additions
and
40 deletions.
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ logs | |
*.log | ||
npm-debug.log* | ||
.eslintcache | ||
.cspellcache | ||
/coverage | ||
/dist | ||
/local | ||
|
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
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
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,49 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`'postprocess' option should work with async "postprocessor" function option: errors 1`] = `[]`; | ||
|
||
exports[`'postprocess' option should work with async "postprocessor" function option: module 1`] = ` | ||
"// Imports | ||
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js"; | ||
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png", import.meta.url); | ||
// Module | ||
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___); | ||
var code = "<div>\\n <p>{{firstname}} {{lastname}}</p>\\n <img src=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\" alt=\\"alt\\" />\\n<div>\\n"; | ||
// Exports | ||
export default code;" | ||
`; | ||
exports[`'postprocess' option should work with async "postprocessor" function option: result 1`] = ` | ||
"<div> | ||
<p>{{firstname}} {{lastname}}</p> | ||
<img src="replaced_file_protocol_/webpack/public/path/image.png" alt="alt" /> | ||
<div> | ||
" | ||
`; | ||
exports[`'postprocess' option should work with async "postprocessor" function option: warnings 1`] = `[]`; | ||
exports[`'postprocess' option should work with the "postprocessor" option: errors 1`] = `[]`; | ||
exports[`'postprocess' option should work with the "postprocessor" option: module 1`] = ` | ||
"// Imports | ||
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js"; | ||
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png", import.meta.url); | ||
// Module | ||
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___); | ||
var code = "<img src=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\">\\n<img src=\\"" + 'Hello ' + (1+1) + "\\">\\n<img src=\\"" + require('./image.png') + "\\">\\n<img src=\\"" + new URL('./image.png', import.meta.url) + "\\">\\n<div>" + require('./gallery.html').default + "</div>\\n<!--Works fine, but need improve testing <div>< %= (await import('./gallery.html')).default % ></div>-->\\n"; | ||
// Exports | ||
export default code;" | ||
`; | ||
exports[`'postprocess' option should work with the "postprocessor" option: result 1`] = ` | ||
"<img src="replaced_file_protocol_/webpack/public/path/image.png"> | ||
<img src="Hello 2"> | ||
<img src="/webpack/public/path/image.png"> | ||
<img src="replaced_file_protocol_/webpack/public/path/image.png"> | ||
<div><h2>Gallery</h2></div> | ||
<!--Works fine, but need improve testing <div>< %= (await import('./gallery.html')).default % ></div>--> | ||
" | ||
`; | ||
exports[`'postprocess' option should work with the "postprocessor" option: warnings 1`] = `[]`; |
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
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 @@ | ||
<h2>Gallery</h2> |
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,6 @@ | ||
<img src="image.png"> | ||
<img src="<%= 'Hello ' + (1+1) %>"> | ||
<img src="<%= require('./image.png') %>"> | ||
<img src="<%= new URL('./image.png', import.meta.url) %>"> | ||
<div><%= require('./gallery.html').default %></div> | ||
<!--Works fine, but need improve testing <div>< %= (await import('./gallery.html')).default % ></div>--> |
Oops, something went wrong.