summaryrefslogtreecommitdiff
path: root/rollup.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'rollup.config.js')
-rw-r--r--rollup.config.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/rollup.config.js b/rollup.config.js
index 299bdad92..3dbe29260 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -24,6 +24,12 @@ const tsconfigOverride = {
}
};
+// this is a preamble for the `globals.d.ts` file to allow it to be the default
+// lib for deno.
+const libPreamble = `/// <reference no-default-lib="true"/>
+/// <reference lib="esnext" />
+`;
+
// this is a rollup plugin which will look for imports ending with `!string` and resolve
// them with a module that will inline the contents of the file as a string. Needed to
// support `js/assets.ts`.
@@ -62,7 +68,9 @@ function strings({ include, exclude } = {}) {
transform(code, id) {
if (filter(id)) {
return {
- code: `export default ${JSON.stringify(code)};`,
+ code: `export default ${JSON.stringify(
+ id.endsWith("globals.d.ts") ? libPreamble + code : code
+ )};`,
map: { mappings: "" }
};
}