Function
Static Public Summary | ||
public |
Returns what electron-compile would use as a default rootCacheDir. |
|
public |
createCompilerHostFromBabelRc(file: string, rootCacheDir: string): Promise<CompilerHost> Creates a compiler host from a .babelrc file. |
|
public |
createCompilerHostFromBabelRcSync(file: *, rootCacheDir: *): * |
|
public |
createCompilerHostFromConfigFile(file: string, rootCacheDir: string): Promise<CompilerHost> Creates a compiler host from a .compilerc file. |
|
public |
createCompilerHostFromConfigFileSync(file: *, rootCacheDir: *): * |
|
public |
createCompilerHostFromProjectRoot(rootDir: string, rootCacheDir: string): Promise<CompilerHost> Creates a configured CompilerHost instance from the project root directory. |
|
public |
createCompilerHostFromProjectRootSync(rootDir: *, rootCacheDir: *): * |
|
public |
Allows you to create new instances of all compilers that are supported by electron-compile and use them directly. |
|
public |
forAllFilesSync(rootDirectory: *, func: *, args: ...*) |
|
public |
Returns the default .configrc if no configuration information can be found. |
|
public |
Initialize electron-compile and set it up, either for development or production use. |
|
public |
initializeGlobalHooks(compilerHost: CompilerHost) Initialize the global hooks (protocol hook for file:, node.js hook) independent of initializing the compiler. |
|
public |
initializeProtocolHook(compilerHost: CompilerHost) Initializes the protocol hook on file: that allows us to intercept files loaded by Chromium and rewrite them. |
|
public |
registerRequireExtension(compilerHost: CompilerHost) Initializes the node.js hook that allows us to intercept files loaded by node.js and rewrite them. |
Static Public
public calculateDefaultCompileCacheDirectory(): string source
import {calculateDefaultCompileCacheDirectory} from 'electron-compile/src/config-parser.js'
Returns what electron-compile would use as a default rootCacheDir. Usually only used for debugging purposes
Return:
string | A path that may or may not exist where electron-compile would set up a development mode cache. |
public createCompilerHostFromBabelRc(file: string, rootCacheDir: string): Promise<CompilerHost> source
import {createCompilerHostFromBabelRc} from 'electron-compile/src/config-parser.js'
Creates a compiler host from a .babelrc file. This method is usually called from createCompilerHostFromProjectRoot instead of used directly.
public createCompilerHostFromBabelRcSync(file: *, rootCacheDir: *): * source
import {createCompilerHostFromBabelRcSync} from 'electron-compile/src/config-parser.js'
Params:
Name | Type | Attribute | Description |
file | * | ||
rootCacheDir | * |
|
Return:
* |
public createCompilerHostFromConfigFile(file: string, rootCacheDir: string): Promise<CompilerHost> source
import {createCompilerHostFromConfigFile} from 'electron-compile/src/config-parser.js'
Creates a compiler host from a .compilerc file. This method is usually called from createCompilerHostFromProjectRoot instead of used directly.
public createCompilerHostFromConfigFileSync(file: *, rootCacheDir: *): * source
import {createCompilerHostFromConfigFileSync} from 'electron-compile/src/config-parser.js'
Params:
Name | Type | Attribute | Description |
file | * | ||
rootCacheDir | * |
|
Return:
* |
public createCompilerHostFromProjectRoot(rootDir: string, rootCacheDir: string): Promise<CompilerHost> source
import {createCompilerHostFromProjectRoot} from 'electron-compile/src/config-parser.js'
Creates a configured CompilerHost instance from the project root directory. This method first searches for a .compilerc, then falls back to the default locations for Babel configuration info. If neither are found, defaults to standard settings
public createCompilerHostFromProjectRootSync(rootDir: *, rootCacheDir: *): * source
import {createCompilerHostFromProjectRootSync} from 'electron-compile/src/config-parser.js'
Params:
Name | Type | Attribute | Description |
rootDir | * | ||
rootCacheDir | * |
|
Return:
* |
public createCompilers(): Object source
import {createCompilers} from 'electron-compile/src/config-parser.js'
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 Jade.
Return:
Object | An Object whose Keys are MIME types, and whose values are instances of @{link CompilerBase}. |
public forAllFilesSync(rootDirectory: *, func: *, args: ...*) source
import {forAllFilesSync} from 'electron-compile/src/for-all-files.js'
Params:
Name | Type | Attribute | Description |
rootDirectory | * | ||
func | * | ||
args | ...* |
public getDefaultConfiguration(): Object source
import {getDefaultConfiguration} from 'electron-compile/src/config-parser.js'
Returns the default .configrc if no configuration information can be found.
public init(appRoot: string, mainModule: string, productionMode: bool) source
import {init} from 'electron-compile/src/config-parser.js'
Initialize electron-compile and set it up, either for development or production use. This is almost always the only method you need to use in order to use electron-compile.
Params:
Name | Type | Attribute | Description |
appRoot | string | The top-level directory for your application (i.e. the one which has your package.json). |
|
mainModule | string | The module to require in, relative to the module calling init, that will start your app. Write this as if you were writing a require call from here. |
|
productionMode | bool | If explicitly True/False, will set read-only mode to be disabled/enabled. If not, we'll guess based on the presence of a production cache. |
public initializeGlobalHooks(compilerHost: CompilerHost) source
import {initializeGlobalHooks} from 'electron-compile/src/config-parser.js'
Initialize the global hooks (protocol hook for file:, node.js hook) independent of initializing the compiler. This method is usually called by init instead of directly
Params:
Name | Type | Attribute | Description |
compilerHost | CompilerHost | The compiler host to use. |
public initializeProtocolHook(compilerHost: CompilerHost) source
import {initializeProtocolHook} from 'electron-compile/src/protocol-hook.js'
Initializes the protocol hook on file: that allows us to intercept files loaded by Chromium and rewrite them. This method along with registerRequireExtension are the top-level methods that electron-compile actually uses to intercept code that Electron loads.
Params:
Name | Type | Attribute | Description |
compilerHost | CompilerHost | The compiler host to use for compilation. |
public registerRequireExtension(compilerHost: CompilerHost) source
import registerRequireExtension from 'electron-compile/src/require-hook.js'
Initializes the node.js hook that allows us to intercept files loaded by node.js and rewrite them. This method along with initializeProtocolHook are the top-level methods that electron-compile actually uses to intercept code that Electron loads.
Params:
Name | Type | Attribute | Description |
compilerHost | CompilerHost | The compiler host to use for compilation. |