-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize the worker packaging process (#651)
- Loading branch information
Showing
6 changed files
with
54 additions
and
60 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
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
export default function WorkerPlugin() { | ||
return { | ||
name: 'maptalks-worker-resolve', // 此名称将出现在警告和错误中 | ||
// resolveId(source) { | ||
// if (source === 'virtual-module') { | ||
// // 这表示 rollup 不应询问其他插件或 | ||
// // 从文件系统检查以找到此 ID | ||
// return source; | ||
// } | ||
// return null; // 其他ID应按通常方式处理 | ||
// }, | ||
renderChunk(code, chunk) { | ||
code = code.replace('define([\'exports\'],', ''); | ||
code = code.replace('define(["exports"],', ''); | ||
code = code.substring(0, code.length - 2); | ||
return 'export default `' + code + '`'; | ||
} | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.