@paulcbetts/electron-compile
Electron supporting package to compile JS and CSS in Electron applications
Last updated 5 years ago by paulcbetts .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @paulcbetts/electron-compile 
SYNC missed versions from official npm registry.

electron-compile

electron-compile provides compilers for common JavaScript and CSS alternative targets.

For JavaScript:

  • JavaScript ES6/ES7 (via Babel)
  • TypeScript
  • CoffeeScript

For CSS:

  • LESS
  • Sass/SCSS

How does it work?

Put this in your Electron app's app.ready:

app.on('ready', function() {
  require('electron-compile').init();
});

From then on, you can now simply include files directly in your HTML, no need for cross-compilation:

<head>
  <script src="main.coffee"></script>
  <link rel="stylesheet" type="text/css" href="main.less" />
</head>

or just require them in via io.js:

require('./mylib')   // mylib.ts

Does this work node.js too?

The JavaScript compilers will register with module.register, but CSS of course won't

Babel keeps running on my ES5 source

Add 'use nobabel'; to the top of your file to opt-out of Babel compilation.

Current Tags

  • 0.1.3                                ...           latest (5 years ago)

2 Versions

  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (12)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |