@NgModule({
imports: [
BrowserModule,
UpgradeModule
]
})
export class AppModule {
constructor(private upgrade: UpgradeModule) {
}
ngDoBootstrap() {
this.upgrade.bootstrap(document.documentElement, ['ng1migrate'], {strictDi: true});
}
}
Я пытаюсь перейти на Angular с AngularJs (1.6.6) и двойной загрузки. Когда я собираю проект с использованием webpack4, он выдает ошибку
tsconfig. json для справки
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"lib": ["es6", "dom","ES2015"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
webpack.config . js для ссылки
const path = require('path');
module.exports = {
entry: './src/app/main.ts',
output: {
path: path.resolve(__dirname, './src/dist'),
filename: 'bundle.js'
},
resolve:{
extensions:[".webpack.js",".web.js",".ts",".tsx",".js"]
},
module:{
rules:[
{
test: /\.ts$/,
loader: 'ng-annotate-loader?ngAnnotate=ng-annotate-patched!ts-loader',
},
{test:/\.tsx?$/, use:"ts-loader"},
]
},
}
версии: "ts-loader": "^ 7.0.1", "typcript": "^ 3.8.3", "webpack": "^ 4.43.0 "," webpack-cli ":" ^ 3.3.11 "