Load CoffeeScript when using a custom resource path

Load CoffeeScript early whenever the resource path a subdirectory
from process.resourcesPath

Close #3993
Esse commit está contido em:
Kevin Sawicki
2014-10-29 10:21:23 -07:00
commit 0c590d6170
2 arquivos alterados com 5 adições e 3 exclusões
+1 -1
Ver Arquivo
@@ -192,7 +192,7 @@ resolveModulePath = (relativePath, parentModule) ->
return
registerBuiltins = (devMode) ->
if devMode
if devMode or not cache.resourcePath.startsWith("#{process.resourcesPath}#{path.sep}")
fs = require 'fs-plus'
atomCoffeePath = path.join(cache.resourcePath, 'exports', 'atom.coffee')
cache.builtins.atom = atomCoffeePath if fs.isFileSync(atomCoffeePath)
+4 -2
Ver Arquivo
@@ -5,8 +5,10 @@ window.onload = function() {
// Skip "?loadSettings=".
var loadSettings = JSON.parse(decodeURIComponent(location.search.substr(14)));
var devMode = loadSettings.devMode || !loadSettings.resourcePath.startsWith(process.resourcesPath + require('path').sep);
// Require before the module cache in dev mode
if (loadSettings.devMode) {
if (devMode) {
require('coffee-script').register();
}
@@ -25,7 +27,7 @@ window.onload = function() {
require('vm-compatibility-layer');
if (!loadSettings.devMode) {
if (!devMode) {
require('coffee-script').register();
}