我正在使用 Angular 14 和 Webpack 版本:^5.58.1。
下面是配置:
webpack.config.js
const webpackPlugin = require('@ngtools/webpack').AngularWebpackPlugin;
module.exports = {
mode: 'development',
devtool: "source-map",
entry: {
main: "./js/main.js",
mainDrawer: "./js/divdrawer/main.ts",
polyfills: "./js/divdrawer/polyfills.ts",
entry: "./js/entry.js",
thirdpartylibs: "./js/thirdpartylibs.js"
},
output: {
path: path.join(__dirname, "build/"),
filename: "[name]bundle.js"
},
module: {
rules: [
{
parser: {
system: true,
}
}
test : /\.(tsx|ts)$/,
use: [
{
loader: '@ngtools/webpack',
options: {
configFile: path.resolve('./js/tsconfig.json')
},
},
]
},
},
plugins: [
new webpackPlugin({
tsconfig: './js/tsconfig.json',
}),
new webpack.ContextReplacementPlugin(
/\@angular(\\|\/)core(\\|\/)esm5/, …Run Code Online (Sandbox Code Playgroud) javascript angular-webpack webpack-5 angular14 angular14upgrade
我最近使用命令将 Angular 从 v12 升级到 v14 ng update,并手动进行了所需的修改。该命令添加了一个.angular带有缓存库的文件夹,该文件夹看起来很大:
但它没有将缓存文件夹添加到.gitignore.
我应该添加.angular到我的吗.gitignore?
我收到此错误错误:NG04014:路由“检查//”的配置无效:redirectTo 和 canActivate 不能一起使用。重定向发生在激活之前,因此 canActivate 永远不会被执行。将 Angular 13 升级到 14 后。有人可以帮忙吗?