Skip to content

Commit

Permalink
Fix bug with windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-c committed Aug 6, 2021
1 parent fd44e2e commit ea0c543
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const processCSS = async (directory: string, options: BuildOptions) => {
}

const processor = postcss(plugins)
const cssFiles = (await glob(path.join(directory, '**/*.css')))
const cssFiles = (await glob(path.join(directory, '**/*.css').replace(/\\/g, '/')))

for (const cssFile of cssFiles) {
const filePath = path.resolve(cssFile)
Expand Down
6 changes: 3 additions & 3 deletions src/lib/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const buildJsFile = async (fromFile: string, toFile: string) => {
jsxFactory: 'Dhow.createElement',
jsxFragment: 'Dhow.Fragment',
// ...and inject the relevant import into every file
external: [ 'dhow' ],
external: [ '@fsoc/dhow' ],
inject: [ path.join(__dirname, '/import-shim.js') ],
})
}
Expand Down Expand Up @@ -202,7 +202,7 @@ export const buildPages = async (

// Build all .js files (pages) to staging (JSX -> regular JS)
const jsFilePaths = options.initial ? (
await glob(path.join(fromPath, '**/*.js'))
await glob(path.join(fromPath, '**/*.js').replace(/\\/g, '/'))
) : (
options.changes
.filter((c) => c.type !== 'unlink' && c.path.startsWith(fromPath))
Expand Down Expand Up @@ -267,7 +267,7 @@ export const buildPages = async (
const Wrapper = getWrapper(stagingPath)

// Get the paths to all pages (all .js files in staging)
const pagePaths = await glob(path.join(stagingPath, '**/*.js'))
const pagePaths = await glob(path.join(stagingPath, '**/*.js').replace(/\\/g, '/'))

debug('building pages at the paths %o', pagePaths)

Expand Down

0 comments on commit ea0c543

Please sign in to comment.