|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sass = require('sass'); |
|
|
|
|
|
|
|
|
const styles = require('../app/styles'); |
|
|
|
|
|
|
|
|
console.log("Hello there") |
|
|
|
|
|
|
|
|
async function start(){ |
|
|
|
|
|
let style = null; |
|
|
|
|
|
try { |
|
|
|
|
|
style = await styles.render("main"); |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (style !== null){ |
|
|
|
|
|
console.log(style); |
|
|
|
|
|
let e = document.createElement('style'); |
|
|
|
|
|
e.innerHTML = style.css.toString(); |
|
|
|
|
|
|
|
|
|
|
|
let head = document.getElementsByTagName('head'); |
|
|
|
|
|
if (head.length > 0) |
|
|
|
|
|
head = head[0]; // There should really only be one head... we're not a hydra!!! |
|
|
|
|
|
head.appendChild(e); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log("Kicking the pig!"); |
|
|
|
|
|
start(); |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
sass.render({file: 'view/sass/main.scss'}, (err, res) => { |
|
|
sass.render({file: 'view/sass/main.scss'}, (err, res) => { |
|
|
if (err){ |
|
|
if (err){ |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
|
|
|
|
|
|
head = head[0]; // There should really only be one head... we're not a hydra!!! |
|
|
head = head[0]; // There should really only be one head... we're not a hydra!!! |
|
|
head.appendChild(style); |
|
|
head.appendChild(style); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|