Skip to content

Commit a1bd7e7

Browse files
committed
build: fix resource replacement
correct usage of resource in userscript
1 parent 51a6343 commit a1bd7e7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"https://*.gamer.com.tw/*"
1919
],
2020
"grant": [
21+
"GM_getResourceText",
2122
"GM_xmlhttpRequest",
2223
"GM_setValue",
2324
"GM_getValue"

scripts/external-resource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getExternalTransformMethod(options: PluginOptions) {
4444
return name;
4545
})();
4646

47-
const code = `export default ${resource};`;
47+
const code = `export default GM_getResourceText("${resource}");`;
4848

4949
// eslint-disable-next-line consistent-return
5050
return {

0 commit comments

Comments
 (0)