Skip to content

Commit

Permalink
remove source mapping url
Browse files Browse the repository at this point in the history
move plugin to separate file

commit plugin file

set map to null
  • Loading branch information
Joe Morgan committed Sep 4, 2020
1 parent 10060d9 commit 549caa2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
2 changes: 2 additions & 0 deletions snowpack/src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {rollupPluginDependencyCache} from '../rollup-plugins/rollup-plugin-remot
import {rollupPluginDependencyStats} from '../rollup-plugins/rollup-plugin-stats.js';
import {rollupPluginWrapInstallTargets} from '../rollup-plugins/rollup-plugin-wrap-install-targets';
import {rollupPluginNodeProcessPolyfill} from '../rollup-plugins/rollup-plugin-node-process-polyfill';
import {rollupPluginStripSourceMapping} from '../rollup-plugins/rollup-plugin-strip-source-mapping';
import {scanDepList, scanImports, scanImportsFromFiles} from '../scan-imports.js';
import {printStats} from '../stats-formatter.js';
import {
Expand Down Expand Up @@ -359,6 +360,7 @@ ${colors.dim(
polyfillNode && rollupPluginNodePolyfills(),
...userDefinedRollup.plugins, // load user-defined plugins last
rollupPluginCatchUnresolved(),
rollupPluginStripSourceMapping(),
].filter(Boolean) as Plugin[],
onwarn(warning, warn) {
// Warn about the first circular dependency, but then ignore the rest.
Expand Down
16 changes: 16 additions & 0 deletions snowpack/src/rollup-plugins/rollup-plugin-strip-source-mapping.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {Plugin} from 'rollup';

/**
* rollup-plugin-strip-source-mapping
*
* Remove any lingering source map comments
*/
export function rollupPluginStripSourceMapping(): Plugin {
return {
name: 'snowpack:rollup-plugin-strip-source-mapping',
transform: (code) => ({
code: code.replace(/\/\/+#\s*sourceMappingURL=.+$/gm, ''),
map: null,
}),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,6 @@ class TemplateInstance {
return fragment;
}
}
//# sourceMappingURL=template-XXXXXXXX.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -2507,7 +2506,6 @@ class TemplateResult {
return template;
}
}
//# sourceMappingURL=template-result.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -2954,7 +2952,6 @@ const getOptions = (o) => o &&
(eventOptionsSupported ?
{ capture: o.capture, passive: o.passive, once: o.once } :
o.capture);
//# sourceMappingURL=parts.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -3090,7 +3087,6 @@ class DefaultTemplateProcessor {
}
}
const defaultTemplateProcessor = new DefaultTemplateProcessor();
//# sourceMappingURL=default-template-processor.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand All @@ -3115,7 +3111,6 @@ if (typeof window !== 'undefined') {
* render to and update a container.
*/
const html = (strings, ...values) => new TemplateResult(strings, values, 'html', defaultTemplateProcessor);
//# sourceMappingURL=lit-html.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -4053,7 +4048,6 @@ _a = finalized;
* Marks class as having finished creating properties.
*/
UpdatingElement[_a] = true;
//# sourceMappingURL=updating-element.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -5111,7 +5105,6 @@ class TemplateInstance {
return fragment;
}
}
//# sourceMappingURL=template-XXXXXXXX.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -5199,7 +5192,6 @@ class TemplateResult {
return template;
}
}
//# sourceMappingURL=template-result.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -5646,7 +5638,6 @@ const getOptions = (o) => o &&
(eventOptionsSupported ?
{ capture: o.capture, passive: o.passive, once: o.once } :
o.capture);
//# sourceMappingURL=parts.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -5782,7 +5773,6 @@ class DefaultTemplateProcessor {
}
}
const defaultTemplateProcessor = new DefaultTemplateProcessor();
//# sourceMappingURL=default-template-processor.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand All @@ -5807,7 +5797,6 @@ if (typeof window !== 'undefined') {
* render to and update a container.
*/
const html = (strings, ...values) => new TemplateResult(strings, values, 'html', defaultTemplateProcessor);
//# sourceMappingURL=lit-html.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down Expand Up @@ -6745,7 +6734,6 @@ _a = finalized;
* Marks class as having finished creating properties.
*/
UpdatingElement[_a] = true;
//# sourceMappingURL=updating-element.js.map
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
Expand Down

0 comments on commit 549caa2

Please sign in to comment.