we recently upgraded to angular 5 from angular 4. We also upgraded to webpack 3. Managed to get our aot builds to work by getting rid of main.aot.ts and pointing the to main.ts directly but we are unable to load the build. We see 'AppService is not defined' error. Can someone please help?
main.ts
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
webpack.config.js
module.exports = {
bail: true,
resolve: {
extensions: ['.js', '.ts'],
alias: {
jquery: "jquery/src/jquery"
}
},
entry: {
'app': './app/main.ts',
},
output: {
path: './compiled',
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
plugins: [
new ngToolsWebpack.AngularCompilerPlugin({
tsConfigPath: './tsaotconfig.json',
entryModule: __dirname + '/../app/app.module#AppModule'
}),
]
}
error
Uncaught ReferenceError: AppService is not defined
at e.ctorParameters (http://localhost:4200/bundle/app.js:1:915567)
at e._ownParameters (http://localhost:4200/bundle/app.js:1:60309)
at e.parameters (http://localhost:4200/bundle/app.js:1:60727)
at e.parameters (http://localhost:4200/bundle/app.js:1:1250184)
at e._getDependenciesMetadata (http://localhost:4200/bundle/app.js:1:1439376)
at e._getTypeMetadata (http://localhost:4200/bundle/app.js:1:1438259)
at e.getNonNormalizedDirectiveMetadata (http://localhost:4200/bundle/app.js:1:1431328)
at e._getEntryComponentMetadata (http://localhost:4200/bundle/app.js:1:1442081)
at http://localhost:4200/bundle/app.js:1:1441836
at Array.forEach (native)