Skip to content
This repository has been archived by the owner on Oct 20, 2020. It is now read-only.

Commit

Permalink
fix(minify): make switch work
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed May 23, 2017
1 parent fa94bdd commit 876ad18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const buildPage = (build, config, collections, blocks, content, identifier, temp

// Build page
let pageTemplate = buildTemplate(readFileSync(template, 'utf8'), templateData)
if (config.minify) {
if (build.minify) {
pageTemplate = minify(pageTemplate, {
removeAttributeQuotes: true,
decodeEntities: true,
Expand All @@ -158,7 +158,7 @@ const buildPage = (build, config, collections, blocks, content, identifier, temp
return templateData
}

export const buildSite = (contentFile, templateDir, version, locale, environment = 'production', minify = true) => {
export const buildSite = (contentFile, templateDir, version, locale, environment = 'production', minify = false) => {
const content = JSON.parse(readFileSync(contentFile, 'utf-8'))

// Find includes
Expand Down
2 changes: 1 addition & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ program
.option('-l, --locale <locale>', 'contentful locale')
.option('-t, --templates <templates>', 'template directory')
.option('-e, --environment [environment]', 'environment', 'production')
.option('-m, --minify', 'minify output', false)
.option('-m, --minify', 'minify output')
.action(options => buildSite(options.content, options.templates, options.version, options.locale, options.environment, options.minify))

program.parse(process.argv)

0 comments on commit 876ad18

Please sign in to comment.