Skip to content

Commit

Permalink
fix: normalize file paths in local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Feb 13, 2023
1 parent e317e4c commit 804b100
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,19 @@ const serve = async (env = 'local', config = {}) => {
}
)
.then(async ({html, config}) => {
// Write the file to disk
let source = ''
let dest = ''
let ext = ''

if (Array.isArray(config.build.templates)) {
const match = config.build.templates.find(template => template.source === path.parse(file).dir)
source = get(match, 'source')
dest = get(match, 'destination.path', 'build_local')
source = path.normalize(get(match, 'source'))
dest = path.normalize(get(match, 'destination.path', 'build_local'))
ext = get(match, 'destination.ext', 'html')
} else if (isObject(config.build.templates)) {
source = get(config, 'build.templates.source')
dest = get(config, 'build.templates.destination.path', 'build_local')
source = path.normalize(get(config, 'build.templates.source'))
dest = path.normalize(get(config, 'build.templates.destination.path', 'build_local'))
ext = get(config, 'build.templates.destination.ext', 'html')
}

Expand Down

0 comments on commit 804b100

Please sign in to comment.