How to use the systemjs.constructor function in systemjs

To help you get started, we’ve selected a few systemjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cliqz-oss / browser-core / tests / runners / unit-node.js View on Github external
function describeModule(moduleName, loadDeps, testFn) {
  const localSystem = new systemjs.constructor();
  localSystem.config({
    defaultJSExtensions: true,
    baseURL,
    meta: {
      '*': { format: cliqzConfig.format === 'common' ? 'cjs' : 'register' },
    },
  });

  // list names of all loaded modules so we can unload them after each test
  // check `unloadModules`
  const systemSet = localSystem.set;
  const systemImport = localSystem.import;

  let modules = {};

  localSystem.set = function (name) {
github cliqz-oss / browser-core / tests / runners / unit-node.js View on Github external
function describeModule(moduleName, loadDeps, testFn) {
  const localSystem = new systemjs.constructor();
  localSystem.config({
    defaultJSExtensions: true,
    baseURL,
    meta: {
      '*': { format: cliqzConfig.format === 'common' ? 'cjs' : 'register' },
    },
  });

  // list names of all loaded modules so we can unload them after each test
  // check `unloadModules`
  const systemSet = localSystem.set;
  const systemImport = localSystem.import;

  let modules = {};

  localSystem.set = function (name) {
github plnkr / runtime / src / index.ts View on Github external
const cssLoader = createCssLoader({
            runtime: this,
        });

        this.defaultDependencies = defaultDependencies;
        // this.defaultExtensions = defaultExtensions;
        this.esmLoader = createEsmCdnLoader({ cssLoader });
        this.localLoader = createLocalLoader({
            cssLoader,
            defaultExtensions,
            runtimeHost,
        });
        this.systemLoader = createSystemLoader();
        this.queue = Promise.resolve();
        // this.runtimeHost = runtimeHost;
        this.system = new SystemJS.constructor();
        // Hack to force system to never use node's require
        this.system._nodeRequire = null;
        this.localRoot = this.system.baseURL.replace(
            /^([a-zA-Z]+:\/\/)([^/]*)\/.*$/,
            '$1$2'
        );
        this.transpiler =
            transpiler === false
                ? null
                : transpiler ||
                  createTranspiler({
                      createRuntime,
                      runtime: this,
                      runtimeHost,
                      typescriptVersion: TYPESCRIPT_VERSION,
                  });
github jspm / jspm-cli / api.js View on Github external
API.Loader = function() {
  config.loadSync();

  var cfg = config.getLoaderConfig();

  var loader = new SystemJSLoader();
  loader.config(cfg);

  return loader;
};