Skip to content

Commit

Permalink
fix: make file config optional
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Oct 2, 2022
1 parent af1d4e0 commit 28d42c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/generators/output/to-disk.js
Expand Up @@ -103,6 +103,7 @@ module.exports = async (env, spinner, config) => {

try {
const compiled = await render(html, {
useFileConfig: true,
maizzle: {
...config,
env
Expand Down
4 changes: 3 additions & 1 deletion src/generators/output/to-string.js
Expand Up @@ -17,7 +17,9 @@ module.exports = async (html, options) => {
throw new RangeError('received empty string')
}

const fileConfig = await Config.getMerged(process.env.NODE_ENV)
const fileConfig = get(options, 'useFileConfig')
? await Config.getMerged(process.env.NODE_ENV)
: {}

let config = merge(fileConfig, get(options, 'maizzle', {}))

Expand Down

0 comments on commit 28d42c3

Please sign in to comment.