Skip to content

Commit

Permalink
fix: including Serge config file in NPM package (fixes #30) (#32)
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Lockhart <“[email protected]”>
  • Loading branch information
dlockhart and Dave Lockhart authored May 27, 2021
1 parent 34161c8 commit 62e2400
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/generators/default-content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ import { copyFile, copyFilesInDir, getDestinationPath, replaceText } from '../..
export function run(templateData) {

const replacementsPackage = templateData;
replacementsPackage.locales = templateData.localization && templateData.localizationType !== 'static' ? ',\n"/lang"' : '';
replacementsPackage.locales = '';
if (templateData.localization) {
if (templateData.localizationType === 'serge') {
replacementsPackage.locales += `,\n"${templateData.hyphenatedName}.serge.json"`;
}
if (templateData.localizationType !== 'static') {
replacementsPackage.locales += ',\n"/lang"';
}
}
copyFile(
`${__dirname}/templates/configured/_package.json`,
`${getDestinationPath(templateData.hyphenatedName)}/package.json`
Expand Down

0 comments on commit 62e2400

Please sign in to comment.