Angular npm package.json未记录的密钥
我在Angular 2/4的源代码package.json中看到一些未记录的键:Angular npm package.json未记录的密钥,angular,npm,module,ecmascript-6,package.json,Angular,Npm,Module,Ecmascript 6,Package.json,我在Angular 2/4的源代码package.json中看到一些未记录的键: { "name": "@angular/platform-browser/animations", "typings": "../animations.d.ts", "main": "../bundles/platform-browser-animations.umd.js", "module": "../@angular/platform-browser/animations.es5.js",
{
"name": "@angular/platform-browser/animations",
"typings": "../animations.d.ts",
"main": "../bundles/platform-browser-animations.umd.js",
"module": "../@angular/platform-browser/animations.es5.js",
"es2015": "../@angular/platform-browser/animations.js"
}
特别是“模块”和“es2015”。我在Angular的包裹里都找到了。我很好奇他们是如何决定加载“main”、“modules”还是“es2015”,特别是因为它总是加载“module”(而不是“es2015”模块)。有没有办法强制我的项目使用package.json中的es2015文件?关于字段
-打字脚本类型签名打字
-根据最初的提案,它应该指向具有module
模块语法但仅具有目标环境支持的语法功能的模块。出于某种原因使用ES2015
非.es5
akaes6
ES2015
-未转换的ES6代码。由Angular引入(不知道任何支持它的工具)es2015
resolve.mainFields
module.exports = {
resolve: {
mainFields: ['es2015', 'browser', 'module', 'main'],
},
···
};