2017-05-26 60 views
0

我想创建带有弹出窗口,选项页面和后台进程的Chrome扩展。所以基本上是一个角度的应用程序与popup.html,options.html和background.html页面。这是可能的角cli?使用@ angular/cli构建Chrome扩展弹出窗口,选项和背景

今天我可以做到这一点与每个页面的多个webpack配置,它的工作原理。现在我想用angular-cli替换它。任何人都可以点我正确的方向,即种子项目或启动例如

感谢

+0

https://stackoverflow.com/questions/42430369/angularjs2-cli-building-chrome-extension-troubles-to-defining-content-and-back我会看看如果这工作出来 – surya

回答

1

所以很多谷歌上搜索后,这blog post帮助了我。 TLDR;不需要多个应用程序,单个应用程序将使用查询参数。例如在我的manifest.json我现在有这个

"browser_action": { 
    "default_popup": "index.html?page=popup" 
}, 
"options_page": "index.html?page=options", 
"background": { 
    "page": "index.html?page=background", 
    "persistent": false 
}, 

然后在路线确定不同的组件(PopupComponent,OptionsComponent和BackgroundComponent)后,导航基础上的“页面” PARAM。

相关问题