首页 > 解决方案 > --dev 选项在 Angular CLI 中不起作用

问题描述

标签: angular-cli-v6

解决方案


是的,他们更改了生成的捆绑包的名称。

角cli v 1.7

node_modules/@angular/cli/models/webpack-configs/common.js

output: {
        path: path.resolve(buildOptions.outputPath),
        publicPath: buildOptions.deployUrl,
        filename: `[name]${hashFormat.chunk}.bundle.js`,
        chunkFilename: `[id]${hashFormat.chunk}.chunk.js`
    }

角cli v6

node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js

output: {
        path: path.resolve(root, buildOptions.outputPath),
        publicPath: buildOptions.deployUrl,
        filename: `[name]${hashFormat.chunk}.js`,
    },

并且 dev 是使用ng buildAFAIK时的默认模式


推荐阅读