I have an ASP.NET Core
site with 2 pages, page routing is done through MVC
, not Angular 2
. Each of these pages has its own Angular 2
application. It is very difficult for me to try to get this to work with webpack
.
If I load both components into one module, I get the error The selector "xxx" did not match any elements
. However, if I try to create multiple webpack.config.js
in webpack.config.js
, then the polyfills
will exit because it cannot find another module.
How do I make this work? The only option available to me here is to force the use of an Angular 2
router and create a SPA?
Here is the relevant part of my webpack.config.js
:
entry: { "polyfills": "./App/polyfills.ts", "vendor": "./App/vendor.ts", "firstapp": "./App/bootfirst.ts", "secondapp": "./App/bootsecond.ts" }, resolve: { extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html'] }, output: { path: process.cwd() + "/wwwroot", publicPath: "/js/", filename: "js/[name].js" },
source share