How to use the systemjs.config 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 Jense5 / consultant-cli / src / core / template.js View on Github external
// @flow

import klaw from 'klaw';
import path from 'path';
import chalk from 'chalk';
import rfse from 'fs-extra';
import winston from 'winston';
import Promise from 'bluebird';
import Mustache from 'mustache';
import inquirer from 'inquirer';
import SystemJS from 'systemjs';

import utils from '../utils/utils';

const fse = Promise.promisifyAll(rfse);
SystemJS.config({
  transpiler: 'plugin-babel',
  map: {
    'plugin-babel': path.resolve(__dirname, '../../node_modules/systemjs-plugin-babel/plugin-babel.js'),
    'systemjs-babel-build': path.resolve(__dirname, '../../node_modules/systemjs-plugin-babel/systemjs-babel-browser.js'),
  },
});

/**
 * This class represents a template, which will be able to render to some output location.
 * All the data and render processes are stored in this instance.
 */
class Template {

  filters: Map<string, (options: Object) => boolean>;
  source: string;
  start: string;
github FE-Kits / fe-boilerplates / micro-frontend / react-ts-webpack / packages / rtw-bootstrap / src / launcher / resolvers / ModuleResolver.ts View on Github external
constructor(option: IInitOption) {
    // 注册所有的 Vendors
    if (option.vendors) {
      option.vendors.forEach(vendor => {
        this.registerSystemMap(vendor);
      });
    }

    // 注册所有的应用
    option.apps.forEach(app => {
      this.registerSystemMap(app);
    });

    // Init systemJS
    SystemJS.config(this.systemConfig);

    // Mount CSS
    this.css.forEach(cssHref => {
      loadCSS(cssHref);
    });

    this.apps = option.apps;
    this.isRegistered = true;

    return this;
  }
github FE-Kits / m-fe-rtw / packages / rtw-bootstrap / src / launcher / resolvers / ModuleResolver.ts View on Github external
constructor(option: IInitOption) {
    // 注册所有的 Vendors
    if (option.vendors) {
      option.vendors.forEach(vendor => {
        this.registerSystemMap(vendor);
      });
    }

    // 注册所有的应用
    option.apps.forEach(app => {
      this.registerSystemMap(app);
    });

    // Init systemJS
    SystemJS.config(this.systemConfig);

    // Mount CSS
    this.css.forEach(cssHref => {
      loadCSS(cssHref);
    });

    this.apps = option.apps;
    this.isRegistered = true;

    return this;
  }
github jspm / jspm-cli / lib / core.js View on Github external
.then(function() {
    System.config(config.getLoaderConfig());
    if (production || process.env.NODE_ENV === 'production')
      System.config({ production: true });
    return System.import(moduleName)
    .then(function(m) {
      if (view)
        console.log(m);
    });
  })
  .catch(function(e) {
github heineiuo / react-web / packages / app-registry / src / AppRegistry.js View on Github external
registerComponent: (appKey, componentProvider, config) => {
    if (config.systemConfig) {
      SystemJS.config(config.systemConfig)
    }
    const App = componentProvider()
    const { historyType } = App
    const AppWithRouter = withRouter(App)
    const history = historyType === 'hash'
      ? createHashHistory() : historyType === 'browser'
        ? createBrowserHistory()
        : createMemoryHistory()

    const loggerMiddleware = store => next => action => {
      if (process.env.NODE_ENV !== 'production') console.warn(action)
      return next(action)
    }

    const create = global.devToolsExtension ? global.devToolsExtension()(createStore) : createStore