Skip to content

Commit

Permalink
fix(next): fix dist output
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Jan 20, 2020
1 parent 686f155 commit aa57ebc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/component-lazy/generate-cjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function generateShortcuts(config: d.Config, compilerCtx: d.CompilerCtx, rollupR
if (o.cjsIndexFile) {
const entryPointPath = config.sys.path.join(o.cjsDir, indexFilename);
const relativePath = relativeImport(config, o.cjsIndexFile, entryPointPath);
const shortcutContent = `module.exports = require('${relativePath}');`;
const shortcutContent = `module.exports = require('${relativePath}');\n`;
await compilerCtx.fs.writeFile(o.cjsIndexFile, shortcutContent);
}
}));
Expand Down
2 changes: 2 additions & 0 deletions src/compiler_next/config/outputs/validate-dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const validateDist = (config: d.Config, userOutputs: d.OutputTarget[]) =>
const distOutputTargets = userOutputs.filter(isOutputTargetDist);
return distOutputTargets.reduce((outputs, o) => {
const distOutputTarget = validateOutputTargetDist(config, o);
outputs.push(distOutputTarget);

if (distOutputTarget.collectionDir) {
outputs.push({
type: DIST_COLLECTION,
Expand Down
2 changes: 1 addition & 1 deletion src/compiler_next/output-targets/dist-lazy/generate-cjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const generateShortcuts = (config: d.Config, compilerCtx: d.CompilerCtx, rollupR
if (o.cjsIndexFile) {
const entryPointPath = config.sys.path.join(o.cjsDir, indexFilename);
const relativePath = relativeImport(config, o.cjsIndexFile, entryPointPath);
const shortcutContent = `module.exports = require('${relativePath}');`;
const shortcutContent = `module.exports = require('${relativePath}');\n`;
await compilerCtx.fs.writeFile(o.cjsIndexFile, shortcutContent, { outputTargetType: o.type });
}
}));
Expand Down

1 comment on commit aa57ebc

@bitflower
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah ;-)

Please sign in to comment.