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:
@@ -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
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário