Skip to content

Commit

Permalink
windows :/
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisonian committed Apr 15, 2022
1 parent 37fcf05 commit 389b1a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ matrix:

environment:
matrix:
- nodejs_version: '14'
- nodejs_version: '16'
- nodejs_version: '17'

Expand Down
6 changes: 5 additions & 1 deletion packages/idyll-cli/src/pipeline/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const mustache = require('mustache');
const resolve = require('resolve');
const slash = require('slash');
const os = require('os');

const {
getProperty,
Expand Down Expand Up @@ -169,6 +170,7 @@ exports.getBaseHTML = (ast, template, opts) => {

exports.getHTML = async (paths, ast, _components, datasets, template, opts) => {
const components = {};
const isWindows = os.platform().includes('win');

for (key of Object.keys(_components)) {
// .forEach(key => {
Expand All @@ -178,7 +180,9 @@ exports.getHTML = async (paths, ast, _components, datasets, template, opts) => {
components[key] = require(_components[key]);
} catch (e) {
try {
components[key] = await import(_components[key]);
components[key] = await import(isWindows
? `file://${_components[key].replace(/\\/g, '\\\\')}`
: _components[key]);
} catch (er) {
console.warn(
`Could not import component ${key} for server-side rendering.`
Expand Down

0 comments on commit 389b1a8

Please sign in to comment.