This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
electron-compile 0.4.0
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