mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Rearrange module loader to work with browserify
This commit is contained in:
@@ -8,24 +8,25 @@ declare var exports: any;
|
||||
declare var module: any;
|
||||
declare var define: any;
|
||||
declare var require: any;
|
||||
declare var window: any;
|
||||
|
||||
(function (addon) {
|
||||
if ('Terminal' in window) {
|
||||
/*
|
||||
/**
|
||||
* Plain browser environment
|
||||
*/
|
||||
addon((<any>window).Terminal);
|
||||
addon(window.Terminal);
|
||||
} else if (typeof exports === 'object' && typeof module === 'object') {
|
||||
/**
|
||||
* CommonJS environment
|
||||
*/
|
||||
const xterm = '../../xterm';
|
||||
module.exports = addon(require(xterm));
|
||||
} else if (typeof define == 'function') {
|
||||
/*
|
||||
/**
|
||||
* Require.js is available
|
||||
*/
|
||||
define(['../../xterm'], addon);
|
||||
} else if (typeof exports === 'object' && typeof module === 'object') {
|
||||
/*
|
||||
* CommonJS environment
|
||||
*/
|
||||
var xterm = '../../xterm'; // Put in a variable do it's not pulled in by browserify
|
||||
module.exports = addon(require(xterm));
|
||||
}
|
||||
})((Terminal: any) => {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user