Skip to content

Commit

Permalink
fix up sourcemap typings
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Mar 14, 2018
1 parent 0c39c72 commit f56f1d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Chunk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { timeEnd, timeStart } from './utils/timers';
import { decode } from 'sourcemap-codec';
import MagicString, { Bundle as MagicStringBundle } from 'magic-string';
import MagicString, { Bundle as MagicStringBundle, SourceMap } from 'magic-string';
import { blank, forOwn } from './utils/object';
import Module, { ModuleJSON } from './Module';
import finalisers from './finalisers/index';
Expand Down Expand Up @@ -780,7 +780,7 @@ export default class Chunk {
if (footer) magicString.append('\n' + footer);

const prevCode = magicString.toString();
let map: RawSourceMap = null;
let map: SourceMap = null;
const bundleSourcemapChain: RawSourceMap[] = [];

return transformBundle(prevCode, this.graph.plugins, bundleSourcemapChain, options).then(
Expand Down
3 changes: 2 additions & 1 deletion src/rollup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { Deprecation } from '../utils/deprecateOptions';
import Graph from '../Graph';
import { TransformContext } from '../utils/transform';
import ensureArray from '../utils/ensureArray';
import { SourceMap } from 'magic-string';

export const VERSION = '<@VERSION@>';

Expand Down Expand Up @@ -246,7 +247,7 @@ export interface OutputChunk {
exports: string[];
modules: ModuleJSON[];

generate: (outputOptions: OutputOptions) => Promise<{ code: string; map: RawSourceMap }>;
generate: (outputOptions: OutputOptions) => Promise<{ code: string; map: SourceMap }>;
write: (options: OutputOptions) => Promise<void>;
getTimings?: () => SerializedTimings;
}
Expand Down
3 changes: 2 additions & 1 deletion src/utils/collapseSourcemaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { basename, dirname, relative, resolve } from './path';
import Module from '../Module';
import { RawSourceMap } from 'source-map';
import Chunk from '../Chunk';
import { SourceMap } from 'magic-string';

class Source {
isOriginal: boolean;
Expand Down Expand Up @@ -128,7 +129,7 @@ class Link {
export default function collapseSourcemaps(
bundle: Chunk,
file: string,
map: RawSourceMap,
map: SourceMap,
modules: Module[],
bundleSourcemapChain: RawSourceMap[]
) {
Expand Down

0 comments on commit f56f1d2

Please sign in to comment.