summaryrefslogtreecommitdiff
path: root/rollup.config.js
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-11-05 11:26:15 +1100
committerRyan Dahl <ry@tinyclouds.org>2018-11-05 13:26:54 -0800
commit5c51cffacfab777eed6c5eb5135a3168dcea37ef (patch)
tree42138d70e42b725620614d2bbcca3807c27969a3 /rollup.config.js
parentb3400d822f6e9a1100e693cc06cd09c8249d4422 (diff)
Omit sources from source maps in bundle.
Diffstat (limited to 'rollup.config.js')
-rw-r--r--rollup.config.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/rollup.config.js b/rollup.config.js
index a648c6470..1996d2b3e 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,5 +1,5 @@
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
-import assert from "assert";
+// @ts-check
import * as fs from "fs";
import path from "path";
import alias from "rollup-plugin-alias";
@@ -30,10 +30,14 @@ const tsconfigOverride = {
}
};
-// 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`.
-function strings({ include, exclude } = {}) {
+/** 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`.
+ * @param {any} param0
+ */
+function strings(
+ { include, exclude } = { include: undefined, exclude: undefined }
+) {
if (!include) {
throw new Error("include option must be passed");
}
@@ -85,7 +89,9 @@ const osNodeToDeno = {
linux: "linux"
};
-// Inject deno.platform.arch and deno.platform.os
+/** Inject deno.platform.arch and deno.platform.os
+ * @param {any} param0
+ */
function platform({ include, exclude } = {}) {
if (!include) {
throw new Error("include option must be passed");
@@ -132,7 +138,7 @@ function resolveGenerated() {
}
function generateDepFile({ outputFile, sourceFiles = [], configFiles = [] }) {
- let timestamp = Date.now();
+ let timestamp = new Date();
// Save the depfile just before the node process exits.
process.once("beforeExit", () =>
@@ -209,7 +215,8 @@ export default function makeConfig(commandOptions) {
output: {
format: "iife",
name: "denoMain",
- sourcemap: true
+ sourcemap: true,
+ sourcemapExcludeSources: true
},
plugins: [