Closed jamen closed 8 years ago
Sure, I'd take a PR for it
Submit a PR to this repo for the compiler, then submit a PR to electron-compile to add some tests, use npm link
to pull it in. If that makes no sense, let me know and I can help out :)
I was just playing around with this today, but I must be missing something... I've created a new class in src/css/stylus.js
which extends the SimpleCompilerBase
class, set up the compileSync()
method, and then I added the mime type and extension to rig-mime-types.js
in the other repo. I added some logs to make sure it was getting into the new class constructor, which it is, but it's never getting into the compileSync
method...
What am I missing?
@lellimecnar Send up what you've got as PRs and I'll have a look, it sounds like you're on the right track
@paulcbetts #36 let me know if I should create a pr for the changes to the other repo as well
@lellimecnar Please do!
I manually updated db.json
in mime-db
to include the stylus mime type, and it's at least compiling. For whatever reason, modifying rig-mime-types.js
wasn't enough.
I'm assuming there was a reason for using a scoped version of mime-db
? Can that be updated?
@lellimecnar Yeah, the scoped version is intentional because the original mime-db
takes up a ton of memory
So, since we're only working with a handful of mime types, can we just forgo the module altogether, and use the file extension instead? Since that's really all the module is doing anyway...
@lellimecnar I actually just got it working with the custom mime-db, my big problem right now is that Stylus only offers an async API, which only happens to work for compileSync atm, it's not guaranteed to (because stylus could choose to call the fn
later)
Added in 3.2.0!
Awesome, thanks @lellimecnar and @paulcbetts.
I use Stylus primarily. Stylus is made in JavaScript, so it should be okay.