0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 22:49:01 -05:00

🐛 Restore css hot-reloading.

This commit is contained in:
Andrey Antukh 2020-06-05 14:14:49 +02:00
parent 49beffa2c8
commit 5f9d3606f6
2 changed files with 15 additions and 2 deletions

View file

@ -44,6 +44,14 @@ function scssPipeline(options) {
}); });
}; };
const touch = (_path) => {
return new Promise((resolve, reject) => {
return fs.utimes(file.path, new Date(), new Date(), () => {
resolve(_path);
});
})
};
const render = (input) => { const render = (input) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
sass.render({file: input}, async function(err, result) { sass.render({file: input}, async function(err, result) {
@ -69,7 +77,11 @@ function scssPipeline(options) {
return mkdirp(path.dirname(output)) return mkdirp(path.dirname(output))
.then(() => render(input)) .then(() => render(input))
.then((res) => postprocess(res, input, output)) .then((res) => postprocess(res, input, output))
.then((res) => write(output, res)) .then(async (res) => {
await write(output, res);
await touch(output);
return res;
})
.catch((err) => null) .catch((err) => null)
.then(() => { .then(() => {
next(); next();

View file

@ -7,7 +7,8 @@
{:target :browser {:target :browser
:output-dir "resources/public/js/" :output-dir "resources/public/js/"
:asset-path "/js" :asset-path "/js"
:devtools {:browser-inject :main} :devtools {:browser-inject :main
:watch-dir "resources/public"}
:build-options {:manifest-name "manifest.json"} :build-options {:manifest-name "manifest.json"}
:modules :modules