Skip to content

Commit

Permalink
chore(build): comment dep versions
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Aug 15, 2020
1 parent 16f30bc commit f838eea
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions scripts/bundles/plugins/inlined-compiler-deps-plugin.ts
Expand Up @@ -54,6 +54,7 @@ async function bundleCompilerDeps(opts: BuildOptions, inputDir: string) {
format: 'es',
file: cacheFile,
preferConst: true,
banner: `// Rollup ${opts.rollupVersion}`
});

return await fs.readFile(cacheFile, 'utf8');
Expand Down
2 changes: 2 additions & 0 deletions scripts/bundles/plugins/parse5-plugin.ts
Expand Up @@ -92,6 +92,8 @@ async function bundleParse5(opts: BuildOptions) {
code = minified.code;
}

code = `// Parse5 ${opts.parse5Verion}\n` + code;

await fs.writeFile(cacheFile, code);

return code;
Expand Down
9 changes: 4 additions & 5 deletions scripts/bundles/plugins/sizzle-plugin.ts
Expand Up @@ -19,14 +19,14 @@ export function sizzlePlugin(opts: BuildOptions): Plugin {
const f = opts.isProd ? 'sizzle.min.js' : 'sizzle.js';
const sizzlePath = join(opts.nodeModulesDir, 'sizzle', 'dist', f);
const sizzleContent = await fs.readFile(sizzlePath, 'utf8');
return getSizzleBundle(sizzleContent);
return getSizzleBundle(opts, sizzleContent);
},
};
}

function getSizzleBundle(content: string) {
return `export default (function() {
function getSizzleBundle(opts: BuildOptions, content: string) {
return `// Sizzle ${opts.sizzleVersion}
export default (function() {
const window = {
document: {
createElement() {
Expand All @@ -39,7 +39,6 @@ const window = {
}
}
};
const module = { exports: {} };
${content}
Expand Down
2 changes: 2 additions & 0 deletions scripts/bundles/plugins/terser-plugin.ts
Expand Up @@ -58,6 +58,8 @@ async function bundleTerser(opts: BuildOptions) {
code = minified.code;
}

code = `// Terser ${opts.terserVersion}\n` + code;

await fs.writeFile(cacheFile, code);

return code;
Expand Down
1 change: 1 addition & 0 deletions scripts/bundles/plugins/typescript-source-plugin.ts
Expand Up @@ -65,6 +65,7 @@ async function bundleTypeScriptSource(tsPath: string, opts: BuildOptions) {
// this ensures its using our checks. Deno should also use process.browser = true
// because we don't want deno using the node apis
const o: string[] = [];
o.push(`// TypeScript ${opts.typescriptVersion}`);
o.push(`import { IS_NODE_ENV } from '@utils';`);
o.push(`process.browser = !IS_NODE_ENV;`);
o.push(`const ts = {};`);
Expand Down

0 comments on commit f838eea

Please sign in to comment.