1

Currently I am using webpack config from angular cli and am facing the same issue of .map parser. Any work around for issue of parsing maps or addon loader? ES5 code works fine, its an issue with ES6 systemjs

WARNING in ./node_modules/xterm/lib/addons/search/search.js.map
Module parse failed: /home/jack/Projects/C290/website/node_modules/source-map-loader/index.js

Unable to hack into the webconfig. Removing .map files did not help

Update:

import { Terminal } from 'xterm';

@Component({...})
export class AppComponent{
    xterm;
    constructor(){

      // Following line or not - it breaks with search.js.map
      //Terminal.loadAddon('search');

      // The following code when run breaks with the error
      this.xterm = new Terminal();
    }
}

This is the actual problem but where do cli webpack config changes apply? https://github.com/sourcelair/xterm.js/issues/1018

https://github.com/sourcelair/xterm.js/issues/877

4

1 回答 1

0

这个问题应该在 3.0.0 版本之后在 xterm.js 中修复。

以下步骤应该有助于解决您的问题:

  1. 获取最新版本:https ://github.com/xtermjs/xterm.js/releases/tag/3.0.2
  2. 替换为使用插件loadAddon的新 API (手动导入和)applyAddon

您可以在https://github.com/parisk/xterm-webpack看到一个关于其工​​作原理的最小示例。

于 2018-01-17T09:02:11.117 回答