提交 5c51cffa 编写于 作者: K Kitson Kelly 提交者: Ryan Dahl

Omit sources from source maps in bundle.

上级 b3400d82
// 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: [
......
......@@ -7,5 +7,5 @@ NotFound: Cannot resolve module "bad-module.ts" from "[WILDCARD]/tests/error_004
at moduleNames.map.name ([WILDCARD]/js/compiler.ts:[WILDCARD])
at Array.map (<anonymous>)
at DenoCompiler.resolveModuleNames ([WILDCARD]/js/compiler.ts:[WILDCARD])
at Object.compilerHost.resolveModuleNames ([WILDCARD]/third_party/node_modules/typescript/lib/typescript.js:[WILDCARD])
at resolveModuleNamesWorker ([WILDCARD]/third_party/node_modules/typescript/lib/typescript.js:[WILDCARD])
at Object.compilerHost.resolveModuleNames (<anonymous>)
at resolveModuleNamesWorker (<anonymous>)
......@@ -7,5 +7,5 @@ NotFound: Cannot resolve module "bad-module.ts" from "[WILDCARD]/tests/error_005
at moduleNames.map.name ([WILDCARD]/js/compiler.ts:[WILDCARD])
at Array.map (<anonymous>)
at DenoCompiler.resolveModuleNames ([WILDCARD]/js/compiler.ts:[WILDCARD])
at Object.compilerHost.resolveModuleNames ([WILDCARD]/third_party/node_modules/typescript/lib/typescript.js:[WILDCARD])
at resolveModuleNamesWorker ([WILDCARD]/third_party/node_modules/typescript/lib/typescript.js:[WILDCARD])
at Object.compilerHost.resolveModuleNames (<anonymous>)
at resolveModuleNamesWorker (<anonymous>)
......@@ -7,5 +7,5 @@ NotFound: Cannot resolve module "./non-existent" from "[WILDCARD]/tests/error_00
at moduleNames.map.name ([WILDCARD]/js/compiler.ts:[WILDCARD])
at Array.map (<anonymous>)
at DenoCompiler.resolveModuleNames ([WILDCARD]/js/compiler.ts:[WILDCARD])
at Object.compilerHost.resolveModuleNames ([WILDCARD]/third_party/node_modules/typescript/lib/typescript.js:[WILDCARD])
at resolveModuleNamesWorker ([WILDCARD]/third_party/node_modules/typescript/lib/typescript.js:[WILDCARD])
at Object.compilerHost.resolveModuleNames (<anonymous>)
at resolveModuleNamesWorker (<anonymous>)
Subproject commit d1447e6375ebddf590f1cd87219dadeca51cfec1
Subproject commit d2dc0456c23c771781d77c40f8e2c21ba9f5abe7
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册