mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Use the snapshot result to require core modules
This commit is contained in:
@@ -50,6 +50,7 @@ process.on('unhandledRejection', function (e) {
|
||||
})
|
||||
|
||||
cleanOutputDirectory()
|
||||
downloadChromedriver()
|
||||
copyAssets()
|
||||
transpileBabelPaths()
|
||||
transpileCoffeeScriptPaths()
|
||||
@@ -60,7 +61,6 @@ prebuildLessCache()
|
||||
generateMetadata()
|
||||
generateStartupSnapshot()
|
||||
generateAPIDocs()
|
||||
downloadChromedriver()
|
||||
dumpSymbols()
|
||||
.then(packageApplication)
|
||||
.then(packagedAppPath => {
|
||||
|
||||
@@ -11,36 +11,40 @@ module.exports = function () {
|
||||
'atom', 'vm', 'events', 'os', 'assert', 'buffer', 'tty', 'net', 'constants',
|
||||
'http', 'https'
|
||||
])
|
||||
const baseDirPath = path.join(CONFIG.intermediateAppPath, 'static')
|
||||
const snapshotScriptContent = electronLink({
|
||||
baseDirPath: CONFIG.intermediateAppPath,
|
||||
mainPath: path.join(CONFIG.intermediateAppPath, 'src', 'initialize-snapshot.js'),
|
||||
baseDirPath,
|
||||
mainPath: path.resolve(baseDirPath, '..', 'src', 'initialize-application-window.js'),
|
||||
shouldExcludeModule: (modulePath) => {
|
||||
const relativePath = path.relative(CONFIG.intermediateAppPath, modulePath)
|
||||
const relativePath = path.relative(baseDirPath, modulePath)
|
||||
return (
|
||||
modulePath.endsWith('.node') || modulePath === 'buffer-offset-index' ||
|
||||
coreModules.has(modulePath) ||
|
||||
(relativePath.startsWith('src' + path.sep) && relativePath.endsWith('-element.js')) ||
|
||||
relativePath == path.join('exports', 'atom.js') ||
|
||||
relativePath == path.join('src', 'config-schema.js') ||
|
||||
relativePath == path.join('src', 'electron-shims.js') ||
|
||||
relativePath == path.join('src', 'module-cache.js') ||
|
||||
relativePath == path.join('src', 'safe-clipboard.js') ||
|
||||
relativePath == path.join('node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
|
||||
relativePath == path.join('node_modules', 'babel-core', 'index.js') ||
|
||||
relativePath == path.join('node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
|
||||
relativePath == path.join('node_modules', 'cson-parser', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
|
||||
relativePath == path.join('node_modules', 'fs-plus', 'lib', 'fs-plus.js') ||
|
||||
relativePath == path.join('node_modules', 'git-utils', 'lib', 'git.js') ||
|
||||
relativePath == path.join('node_modules', 'less', 'lib', 'less', 'fs.js') ||
|
||||
relativePath == path.join('node_modules', 'less', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
|
||||
relativePath == path.join('node_modules', 'marker-index', 'dist', 'native', 'marker-index.js') ||
|
||||
relativePath == path.join('node_modules', 'mime', 'mime.js') ||
|
||||
relativePath == path.join('node_modules', 'oniguruma', 'lib', 'oniguruma.js') ||
|
||||
relativePath == path.join('node_modules', 'pathwatcher', 'lib', 'main.js') ||
|
||||
relativePath == path.join('node_modules', 'request', 'request.js') ||
|
||||
relativePath == path.join('node_modules', 'resolve', 'index.js') ||
|
||||
relativePath == path.join('node_modules', 'resolve', 'lib', 'core.js') ||
|
||||
relativePath == path.join('node_modules', 'text-buffer', 'node_modules', 'pathwatcher', 'lib', 'main.js')
|
||||
(relativePath.startsWith(path.join('..', 'src')) && relativePath.endsWith('-element.js')) ||
|
||||
relativePath == path.join('..', 'exports', 'atom.js') ||
|
||||
relativePath == path.join('..', 'src', 'config-schema.js') ||
|
||||
relativePath == path.join('..', 'src', 'electron-shims.js') ||
|
||||
relativePath == path.join('..', 'src', 'module-cache.js') ||
|
||||
relativePath == path.join('..', 'src', 'safe-clipboard.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'atom-keymap', 'lib', 'helpers.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'babel-core', 'index.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'clear-cut', 'index.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'cson-parser', 'node_modules', 'coffee-script', 'lib', 'coffee-script', 'register.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'fs-plus', 'lib', 'fs-plus.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'git-utils', 'lib', 'git.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'less', 'lib', 'less', 'index.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'less', 'lib', 'less', 'fs.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'less', 'node_modules', 'graceful-fs', 'graceful-fs.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'marker-index', 'dist', 'native', 'marker-index.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'mime', 'mime.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'oniguruma', 'lib', 'oniguruma.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'pathwatcher', 'lib', 'main.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'request', 'request.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'resolve', 'index.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'resolve', 'lib', 'core.js') ||
|
||||
relativePath == path.join('..', 'node_modules', 'text-buffer', 'node_modules', 'pathwatcher', 'lib', 'main.js')
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user