2017-02-22 96 views
0

我使用this quickstart boilerplate以普通javascript创建Angular 2应用程序。在Angular 2 JavaScript项目中包含Angular 2包

我想要包含我自己定制的由WebPack构建的Angular 2包。这实际上可能吗?如果是这样,那么最好的办法是什么?

此刻,当我尝试从包中添加CustomModelapp.module,我得到以下错误:

Error: Unexpected value 'MyModule' imported by the module 'class1' at SyntaxError.ZoneAwareError 

我纷纷转载和示例这个错误的位置:https://plnkr.co/edit/FqgWgBj2xvPLJmkrsuz1

回答

0

我我认为这个问题与你的孩子模块的创建方式有关。作为this github issue或本github issue,你可能需要这样:

resolve: { 
    modules: [ path.join(projectRoot, "node_modules") ] 
} 

cause your node_modules won't be available from __dirname, __dirname points to webpack.config folder

PS: but if you have custom webpack compilation process, than probably __dirname will work :)

+0

这看起来在另外的情况下,主要的问题是结合2个JS定制包 –

相关问题