Skip to content

[Bug] Angular-cli 8.1 insists on building for es5 while I want only es2015 #14991

Closed
@zijianhuang

Description

@zijianhuang

🐞 Bug report

Command (mark with an x)

- [ x] build

Description

I want es2015 codes only for my LOB app running on Chrome primarily though Firefox and Edge may be supported. I had done respective config in tsconfig.json and package.json.

🔬 Minimal Reproduction

Prerequisites:
Angular 8.1
Angular CLI 8.1

In package.json, I have:

	"browserslist": [
		"last 2 versions",
		"Firefox ESR",
		"not dead",
		"not IE 9-11"
	],

as suggested in https://github.com/browserslist/browserslist

In tsconfig.json,

{
	"compileOnSave": false,
	"compilerOptions": {
		"baseUrl": "./",
		"outDir": "./dist/out-tsc",
		"sourceMap": true,
		"declaration": false,
		"moduleResolution": "node",
		"emitDecoratorMetadata": true,
		"experimentalDecorators": true,
		"target": "es2015",
		"typeRoots": [
			"node_modules/@types"
		],
		"lib": [
			"es2018",
			"dom"
		],
		"skipLibCheck": true
	}
}

🔥 Exception or Error

Both es5 and es2015 codes are produced, while https://angular.io/guide/deployment#differential-loading suggested a single build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions