"dev:full":"concurrently --kill-others \"npm run scss:dev\" \"npm run dev:nodemon\"","dev:nodemon":"nodemon --exec \"npm run dev\"","scss":"sass src/scss/:static/style/","scss:dev":"sass -w src/scss/:static/style/"
Add npm run scss && before the build, package, preview and
prepare scripts
"build":"npm run scss && svelte-kit build","package":"npm run scss && svelte-kit package","preview":"npm run scss && svelte-kit preview","prepare":"npm run scss && svelte-kit sync",
The setup
So I started a little project (hopefully I will write about it soon) and I
tought I would write the frontend in svelte
I don’t need to keep a Hugo executable in the repo, there is an Action that gets
the latest version for me.
I can keep the ssh key in a repository secret instead of the janky encrypted file
that I used before, there probably was a way with Travis, but nothing quite as simple
If you found this post while trying to optimize your angular templates, I have a
cautionary tale for you. This might be just me, but this one hurt.
At work we have an AngularJS application. This application has one particular
list really long, really complex, really grinds the tablets to a halt. How do
you solve that?
My first tought was, there is too many watches in there. One-time bind all the
things. for those of you that dont know one-time binding is done by adding two
colons at the beginnig of the variable name {{::variable}}. It gets evaluated
once, the first time it has a value, and then angular just forgets about it.
The application itself is rather simple, it is carried by two functions, calling
each other.
The first, taking an array, and making a string out of all it’s elements
functionpickOneOfEach (arr) {
letresult=''for (letelofarr) {
if (Array.isArray(el)) {
result+=pickRandom(el)
} else {
result+= String(el) // turn everything to string, because .toString() can be unreliable in what it returns
}
}
returnresult}
And a second one, getting me a random element from an array