Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Releases: electron-userland/electron-compile

electron-compile 2.0

04 Jan 06:19
Compare
Choose a tag to compare

What's New

electron-prebuilt-compile npm module

electron-compile is now bundled with a version of electron-prebuilt that sets up electron-compile automatically. Learn more at https://github.com/paulcbetts/electron-prebuilt-compile.

Performance Performance Performance

electron-compile now reads much less data from disk than it did in 1.0 - in production mode it now should be slightly faster than precompiled files due to GZip compression. The entire compilation infrastructure has also been rewritten to use async methods, which should drastically improve performance when including complex HTML and CSS content.

Support for HTML precompilers including Jade (#45)

electron-compile now has the infrastructure to support HTML precompilers such as HAML and Jade, and ships with Jade enabled in-box.

Simplified Configuration (#47)

electron-compile 1.x was frustrating to configure in any non-default configuration - we now support a .compilerc file which allows developers to configure compiler-specific settings:

{
  "application/javascript": {
    "presets": ["stage-0", "es2015", "react"],
    "sourceMaps": "inline"
  },
  "text/less": {
    "dumpLineNumbers": "comments"
  }
}

Debuggability

electron-compile v2.0 now uses the debug module, so discovering what happened when things go wrong is now much easier:

## Debug just electron-compile
DEBUG=electron-compile:* npm start

## Grab everything except for Babel which is very noisy
DEBUG=*,-babel npm start

electron-compile 0.4.0

01 Jul 05:02
Compare
Choose a tag to compare

What's New

Precompilation (#7)

This release allows you to pre-build the cache folder ahead of time for every file in your app, via a new electron-compile CLI app:

Usage: electron-compile --target [target-path] paths...

Options:
  -t, --target   The target directory to write a cache directory to
  -v, --verbose  Print verbose information
  -h, --help     Show help

This release also adds new methods exported to the main object for compiling via code:

// Public: Compiles a single file given its path.
//
// filePath: The path on disk to the file
// compilers: (optional) - An {Array} of objects conforming to {CompileCache}
//                         that will be tried in-order to compile code. You must
//                         call init() first if this parameter is null.
//
// Returns a {String} with the compiled output, or will throw an {Error} 
// representing the compiler errors encountered.
export function compile(filePath, compilers=null)

// Public: Recursively compiles an entire directory of files.
//
// rootDirectory: The path on disk to the directory of files to compile.
// compilers: (optional) - An {Array} of objects conforming to {CompileCache}
//                         that will be tried in-order to compile code.
//
// Returns nothing.
export function compileAll(rootDirectory, compilers=null)

// Public: Allows you to create new instances of all compilers that are 
// supported by electron-compile and use them directly. Currently supports
// Babel, CoffeeScript, TypeScript, LESS, and Sass/SCSS.
//
// Returns an {Array} of {CompileCache} objects.
export function createAllCompilers()

Bug Fixes

  • Fix a bug where require in the renderer process wouldn't get transpiled files.
  • Fix a bug where imports wouldn't resolve in LESS files