2017-10-12 51 views
1

目前我正在使用來自角度cli的webpack配置,並面臨着.map解析器的相同問題。任何解決地圖或附加加載器問題的解決方法? ES5的代碼工作正常,它與ES6系統的問題模塊解析失敗 - Webpack Angular/cli和xtermjs

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 

無法入侵到webconfig。刪除文件.MAP沒有幫助

更新:

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(); 
    } 
} 

這是實際的問題,但在哪裏CLI的WebPack配置修改申請? https://github.com/sourcelair/xterm.js/issues/1018

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

+0

你有一個簡約的例子,你可以分享? – pixelbits

+0

它是一個大的應用程序。可能無法把所有的代碼。但我更新了實際的破解代碼。 – Gary

+0

您正在使用ts loader嗎? – pixelbits

回答

0

這個問題應該被固定在3.0.0發佈後xterm.js。

應按以下步驟幫助修復您的問題:

  1. 獲取最新版本:https://github.com/xtermjs/xterm.js/releases/tag/3.0.2
  2. 更換loadAddonnew API for using addons(手動導入和applyAddon

你可以看到一個很小例如在https://github.com/parisk/xterm-webpack的工作方式。

+0

是的,已經有3倍的版本。雖然調整大小的一些問題似乎沒有解決。讓我再檢查一次。 – Gary

相關問題