build: remove unused rollup.config.js files (#28646)
Since we build and publish the individual packages using Bazel and `build.sh` has been removed, we can safely remove the `rollup.config.js` files which are no longer needed because the `ng_package` bazel rule automatically handles the rollup settings and globals. PR Close #28646
This commit is contained in:
parent
63e5d2787b
commit
7cbc36fdac
|
@ -59,7 +59,6 @@ merge:
|
|||
- "**/package.json"
|
||||
- "**/tsconfig-build.json"
|
||||
- "**/tsconfig.json"
|
||||
- "**/rollup.config.js"
|
||||
- "**/BUILD.bazel"
|
||||
- "**/*.md"
|
||||
- "packages/**/integrationtest/**"
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/animations': 'ng.animations'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/animations/fesm5/browser.js',
|
||||
dest: '../../../dist/packages-dist/animations/bundles/animations-browser.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/animations/browser'},
|
||||
moduleName: 'ng.animations.browser',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/animations': 'ng.animations',
|
||||
'@angular/animations/browser': 'ng.animations.browser',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../../dist/packages-dist/animations/fesm5/browser/testing.js',
|
||||
dest: '../../../../dist/packages-dist/animations/bundles/animations-browser-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/animations/browser/testing'},
|
||||
moduleName: 'ng.animations.browser.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/animations': 'ng.animations',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/animations/fesm5/animations.js',
|
||||
dest: '../../dist/packages-dist/animations/bundles/animations.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/animations'},
|
||||
moduleName: 'ng.animations',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -3,10 +3,7 @@ package(default_visibility = ["//visibility:public"])
|
|||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
exports_files([
|
||||
"rollup.config.js",
|
||||
"ng_package.bzl",
|
||||
])
|
||||
exports_files(["ng_package.bzl"])
|
||||
|
||||
ts_library(
|
||||
name = "lib",
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/common': 'ng.common',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/common/fesm5/http.js',
|
||||
dest: '../../../dist/packages-dist/common/bundles/common-http.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/common/http'},
|
||||
moduleName: 'ng.common.http',
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,31 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/common/http': 'ng.common.http',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../../dist/packages-dist/common/fesm5/http/testing.js',
|
||||
dest: '../../../../dist/packages-dist/common/bundles/common-http-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/common/http/testing'},
|
||||
moduleName: 'ng.common.http.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/common/fesm5/common.js',
|
||||
dest: '../../dist/packages-dist/common/bundles/common.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
moduleName: 'ng.common',
|
||||
amd: {id: '@angular/common'},
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/common/fesm5/testing.js',
|
||||
dest: '../../../dist/packages-dist/common/bundles/common-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/common/testing'},
|
||||
moduleName: 'ng.common.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,72 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const commonjs = require('rollup-plugin-commonjs');
|
||||
const path = require('path');
|
||||
|
||||
require('reflect-metadata');
|
||||
|
||||
var m = /^\@angular\/((\w|\-)+)(\/(\w|\d|\/|\-)+)?$/;
|
||||
var location = normalize('../../dist/packages-dist') + '/';
|
||||
var rxjsLocation = normalize('../../node_modules/rxjs');
|
||||
var tslibLocation = normalize('../../node_modules/tslib');
|
||||
var esm = 'esm/';
|
||||
|
||||
var locations = {'compiler-cli': normalize('../../dist/packages') + '/'};
|
||||
|
||||
var esm_suffixes = {};
|
||||
|
||||
function normalize(fileName) {
|
||||
return path.resolve(__dirname, fileName);
|
||||
}
|
||||
|
||||
function resolve(id, from) {
|
||||
// console.log('Resolve id:', id, 'from', from)
|
||||
var match = m.exec(id);
|
||||
if (match) {
|
||||
var packageName = match[1];
|
||||
var esm_suffix = esm_suffixes[packageName] || '';
|
||||
var loc = locations[packageName] || location;
|
||||
var r = loc !== location && (loc + esm_suffix + packageName + (match[3] || '/index') + '.js') ||
|
||||
loc + packageName + '/@angular/' + packageName + '.es5.js';
|
||||
// console.log('** ANGULAR MAPPED **: ', r);
|
||||
return r;
|
||||
}
|
||||
if (id && id.startsWith('rxjs/')) {
|
||||
const resolved = `${rxjsLocation}${id.replace('rxjs', '')}.js`;
|
||||
return resolved;
|
||||
}
|
||||
if (id == 'tslib') {
|
||||
return tslibLocation + '/tslib.es6.js';
|
||||
}
|
||||
}
|
||||
|
||||
// hack to get around issues with default exports
|
||||
var banner = `ts['default'] = ts['default'] || ts; fs['default'] = fs['default'] || fs;`;
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/compiler-cli/src/ngc.js',
|
||||
dest: './browser-bundle.umd.js',
|
||||
format: 'umd',
|
||||
amd: {id: '@angular/compiler-cli-browser'},
|
||||
moduleName: 'ng.compiler_cli_browser',
|
||||
exports: 'named',
|
||||
external: [
|
||||
'fs',
|
||||
'path',
|
||||
'typescript',
|
||||
'reflect-metadata',
|
||||
],
|
||||
globals: {
|
||||
'typescript': 'ts',
|
||||
'path': 'path',
|
||||
'fs': 'fs',
|
||||
},
|
||||
banner: banner,
|
||||
plugins: [{resolveId: resolve}, commonjs()]
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/compiler/fesm5/compiler.js',
|
||||
dest: '../../dist/packages-dist/compiler/bundles/compiler.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/compiler'},
|
||||
moduleName: 'ng.compiler',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/core/testing': 'ng.core.testing',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/compiler/fesm5/testing.js',
|
||||
dest: '../../../dist/packages-dist/compiler/bundles/compiler-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/compiler/testing'},
|
||||
moduleName: 'ng.compiler.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/core/fesm5/core.js',
|
||||
dest: '../../dist/packages-dist/core/bundles/core.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/core'},
|
||||
moduleName: 'ng.core',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/core/fesm5/testing.js',
|
||||
dest: '../../../dist/packages-dist/core/bundles/core-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/core/testing'},
|
||||
moduleName: 'ng.core.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/elements/fesm5/elements.js',
|
||||
dest: '../../dist/packages-dist/elements/bundles/elements.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/elements'},
|
||||
moduleName: 'ng.elements',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,31 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/forms/fesm5/forms.js',
|
||||
dest: '../../dist/packages-dist/forms/bundles/forms.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/forms'},
|
||||
moduleName: 'ng.forms',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs': 'rxjs'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/http/fesm5/http.js',
|
||||
dest: '../../dist/packages-dist/http/bundles/http.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/http'},
|
||||
moduleName: 'ng.http',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,31 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/http': 'ng.http',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/http/fesm5/testing.js',
|
||||
dest: '../../../dist/packages-dist/http/bundles/http-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/http/testing'},
|
||||
moduleName: 'ng.http.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,72 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const commonjs = require('rollup-plugin-commonjs');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
var m = /^\@angular\/((\w|\-)+)(\/(\w|\d|\/|\-)+)?$/;
|
||||
var location = normalize('../../dist/packages-dist') + '/';
|
||||
var rxjsLocation = normalize('../../node_modules/rxjs');
|
||||
var tslibLocation = normalize('../../node_modules/tslib');
|
||||
|
||||
var locations = {'compiler-cli': normalize('../../dist/packages') + '/'};
|
||||
|
||||
var esm_suffixes = {};
|
||||
|
||||
function normalize(fileName) {
|
||||
return path.resolve(__dirname, fileName);
|
||||
}
|
||||
|
||||
function resolve(id, from) {
|
||||
// console.log('Resolve id:', id, 'from', from)
|
||||
var match = m.exec(id);
|
||||
if (match) {
|
||||
var packageName = match[1];
|
||||
var esm_suffix = esm_suffixes[packageName] || '';
|
||||
var loc = locations[packageName] || location;
|
||||
var r = loc !== location && (loc + esm_suffix + packageName + (match[3] || '/index') + '.js') ||
|
||||
loc + packageName + '/fesm5/' + packageName + '.js';
|
||||
return r;
|
||||
}
|
||||
if (id && (id == 'rxjs' || id.startsWith('rxjs/'))) {
|
||||
return `${rxjsLocation}${id.replace('rxjs', '')}/index.js`;
|
||||
}
|
||||
if (id == 'tslib') {
|
||||
return tslibLocation + '/tslib.es6.js';
|
||||
}
|
||||
}
|
||||
|
||||
var banner = fs.readFileSync('bundles/banner.js.txt', 'utf8');
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/language-service/fesm5/language-service.js',
|
||||
dest: '../../dist/packages-dist/language-service/bundles/language-service.umd.js',
|
||||
format: 'amd',
|
||||
amd: {
|
||||
// Don't name this module, causes
|
||||
// Loading the language service caused the following exception: TypeError:
|
||||
// $deferred.modules.map is not a function
|
||||
// id: '@angular/language-service'
|
||||
},
|
||||
moduleName: 'ng.language_service',
|
||||
exports: 'named',
|
||||
external: [
|
||||
'fs',
|
||||
'path',
|
||||
'typescript',
|
||||
],
|
||||
globals: {
|
||||
'typescript': 'ts',
|
||||
'path': 'path',
|
||||
'fs': 'fs',
|
||||
},
|
||||
banner: banner,
|
||||
plugins: [{resolveId: resolve}, commonjs(), sourcemaps()]
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/platform-browser-dynamic/fesm5/platform-browser-dynamic.js',
|
||||
dest: '../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-browser-dynamic'},
|
||||
moduleName: 'ng.platformBrowserDynamic',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,34 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/core/testing': 'ng.core.testing',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/compiler/testing': 'ng.compiler.testing',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/platform-browser/testing': 'ng.platformBrowser.testing',
|
||||
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/platform-browser-dynamic/fesm5/testing.js',
|
||||
dest:
|
||||
'../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-browser-dynamic/testing'},
|
||||
moduleName: 'ng.platformBrowserDynamic.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,30 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/animations': 'ng.animations',
|
||||
'@angular/animations/browser': 'ng.animations.browser'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/platform-browser/fesm5/animations.js',
|
||||
dest: '../../../dist/packages-dist/platform-browser/bundles/platform-browser-animations.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-browser/animations'},
|
||||
moduleName: 'ng.platformBrowser.animations',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/platform-browser/fesm5/platform-browser.js',
|
||||
dest: '../../dist/packages-dist/platform-browser/bundles/platform-browser.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-browser'},
|
||||
moduleName: 'ng.platformBrowser',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/core/testing': 'ng.core.testing',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/platform-browser': 'ng.platformBrowser'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/platform-browser/fesm5/testing.js',
|
||||
dest: '../../../dist/packages-dist/platform-browser/bundles/platform-browser-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-browser/testing'},
|
||||
moduleName: 'ng.platformBrowser.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,37 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/animations': 'ng.animations',
|
||||
'@angular/animations/browser': 'ng.animations.browser',
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/common/http': 'ng.common.http',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/http': 'ng.http',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/platform-browser/animations': 'ng.platformBrowser.animations',
|
||||
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/platform-server/fesm5/platform-server.js',
|
||||
dest: '../../dist/packages-dist/platform-server/bundles/platform-server.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-server'},
|
||||
moduleName: 'ng.platformServer',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,33 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/compiler/testing': 'ng.compiler.testing',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/platform-browser/animations': 'ng.platformBrowser.animations',
|
||||
'@angular/platform-server': 'ng.platformServer',
|
||||
'@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/platform-server/fesm5/testing.js',
|
||||
dest: '../../../dist/packages-dist/platform-server/bundles/platform-server-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-server/testing'},
|
||||
moduleName: 'ng.platformServer.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,32 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
|
||||
'@angular/platform-webworker': 'ng.platformWebworker',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/platform-webworker-dynamic/fesm5/platform-webworker-dynamic.js',
|
||||
dest:
|
||||
'../../dist/packages-dist/platform-webworker-dynamic/bundles/platform-webworker-dynamic.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-webworker-dynamic'},
|
||||
moduleName: 'ng.platformWebworkerDynamic',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs': 'rxjs',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/platform-webworker/fesm5/platform-webworker.js',
|
||||
dest: '../../dist/packages-dist/platform-webworker/bundles/platform-webworker.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/platform-webworker'},
|
||||
moduleName: 'ng.platformWebworker',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,13 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
module.exports = {
|
||||
plugins: [sourcemaps()]
|
||||
};
|
|
@ -1,30 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/router/fesm5/router.js',
|
||||
dest: '../../dist/packages-dist/router/bundles/router.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/router'},
|
||||
moduleName: 'ng.router',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,30 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/common/testing': 'ng.common.testing',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/router': 'ng.router'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/router/fesm5/testing.js',
|
||||
dest: '../../../dist/packages-dist/router/bundles/router-testing.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/router/testing'},
|
||||
moduleName: 'ng.router.testing',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,30 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/router': 'ng.router',
|
||||
'@angular/upgrade/static': 'ng.upgrade.static'
|
||||
};
|
||||
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/router/fesm5/upgrade.js',
|
||||
dest: '../../../dist/packages-dist/router/bundles/router-upgrade.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/router/upgrade'},
|
||||
moduleName: 'ng.router.upgrade',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/all/@angular/service-worker/cli-custom/main.js',
|
||||
dest: '../../dist/packages-dist/service-worker/ngsw-config-tmp.js',
|
||||
format: 'iife',
|
||||
plugins: [resolve()],
|
||||
external: [
|
||||
'fs',
|
||||
'path',
|
||||
'@angular/service-worker/config',
|
||||
],
|
||||
};
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/service-worker/fesm5/config.js',
|
||||
dest: '../../../dist/packages-dist/service-worker/bundles/service-worker-config.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
moduleName: 'ng.serviceWorker.config',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/service-worker/fesm5/service-worker.js',
|
||||
dest: '../../dist/packages-dist/service-worker/bundles/service-worker.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
moduleName: 'ng.serviceWorker',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,13 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export default {
|
||||
entry: '../../dist/all/@angular/service-worker/worker-es2017/main.js',
|
||||
dest: '../../dist/packages-dist/service-worker/ngsw-worker.js',
|
||||
format: 'iife',
|
||||
};
|
|
@ -1,32 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../dist/packages-dist/upgrade/fesm5/upgrade.js',
|
||||
dest: '../../dist/packages-dist/upgrade/bundles/upgrade.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/upgrade'},
|
||||
moduleName: 'ng.upgrade',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
const resolve = require('rollup-plugin-node-resolve');
|
||||
const sourcemaps = require('rollup-plugin-sourcemaps');
|
||||
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
entry: '../../../dist/packages-dist/upgrade/fesm5/static.js',
|
||||
dest: '../../../dist/packages-dist/upgrade/bundles/upgrade-static.umd.js',
|
||||
format: 'umd',
|
||||
exports: 'named',
|
||||
amd: {id: '@angular/upgrade/static'},
|
||||
moduleName: 'ng.upgrade.static',
|
||||
plugins: [resolve(), sourcemaps()],
|
||||
external: Object.keys(globals),
|
||||
globals: globals
|
||||
};
|
|
@ -1,167 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import {RuleFailure} from 'tslint/lib';
|
||||
import {AbstractRule} from 'tslint/lib/rules';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
|
||||
function _isRollupPath(path: string) {
|
||||
return /rollup\.config\.js$/.test(path);
|
||||
}
|
||||
|
||||
// Regexes to blocklist.
|
||||
const sourceFilePathBlocklist = [
|
||||
/\.spec\.ts$/,
|
||||
/_spec\.ts$/,
|
||||
/_perf\.ts$/,
|
||||
/_example\.ts$/,
|
||||
/[/\\]test[/\\]/,
|
||||
/[/\\]testing_internal\.ts$/,
|
||||
/[/\\]integrationtest[/\\]/,
|
||||
/[/\\]packages[/\\]bazel[/\\]/,
|
||||
/[/\\]packages[/\\]benchpress[/\\]/,
|
||||
/[/\\]packages[/\\]examples[/\\]/,
|
||||
/[/\\]packages[/\\]elements[/\\]schematics[/\\]/,
|
||||
|
||||
// language-service bundles everything in its UMD, so we don't need a globals. There are
|
||||
// exceptions but we simply ignore those files from this rule.
|
||||
/[/\\]packages[/\\]language-service[/\\]/,
|
||||
|
||||
// Compiler CLI is never part of a browser (there's a browser-rollup but it's managed
|
||||
// separately.
|
||||
/[/\\]packages[/\\]compiler-cli[/\\]/,
|
||||
|
||||
// service-worker is a special package that has more than one rollup config. It confuses
|
||||
// this lint rule and we simply ignore those files.
|
||||
/[/\\]packages[/\\]service-worker[/\\]/,
|
||||
];
|
||||
|
||||
// Import package name whitelist. These will be ignored.
|
||||
const importsWhitelist = [
|
||||
'@angular/compiler-cli', // Not used in a browser.
|
||||
'@angular/compiler-cli/src/language_services', // Deep import from language-service.
|
||||
'chokidar', // Not part of compiler-cli/browser, but still imported.
|
||||
'reflect-metadata',
|
||||
'tsickle',
|
||||
'url', // Part of node, no need to alias in rollup.
|
||||
'zone.js',
|
||||
];
|
||||
|
||||
const packageScopedImportWhitelist: [RegExp, string[]][] = [
|
||||
[/service-worker[/\\]cli/, ['@angular/service-worker']],
|
||||
];
|
||||
|
||||
|
||||
// Return true if the file should be linted.
|
||||
function _pathShouldBeLinted(path: string) {
|
||||
return /[/\\]packages[/\\]/.test(path) && sourceFilePathBlocklist.every(re => !re.test(path));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* .--. _________________
|
||||
* {\ / q {\ / globalGlobalMap /
|
||||
* { `\ \ (-(~` <__________________/
|
||||
* { '.{`\ \ \ )
|
||||
* {'-{ ' \ .-""'-. \ \
|
||||
* {._{'.' \/ '.) \
|
||||
* {_.{. {` |
|
||||
* {._{ ' { ;'-=-. |
|
||||
* {-.{.' { ';-=-.` /
|
||||
* {._.{.; '-=- .'
|
||||
* {_.-' `'.__ _,-'
|
||||
* |||`
|
||||
* .='==,
|
||||
*/
|
||||
interface RollupMatchInfo {
|
||||
filePath: string;
|
||||
globals: {[packageName: string]: string};
|
||||
}
|
||||
const globalGlobalRollupMap = new Map<string, RollupMatchInfo>();
|
||||
|
||||
|
||||
export class Rule extends AbstractRule {
|
||||
public apply(sourceFile: ts.SourceFile): RuleFailure[] {
|
||||
const allImports = <ts.ImportDeclaration[]>sourceFile.statements.filter(
|
||||
x => x.kind === ts.SyntaxKind.ImportDeclaration);
|
||||
|
||||
// Ignore specs, non-package files, and examples.
|
||||
if (!_pathShouldBeLinted(sourceFile.fileName)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Find the rollup.config.js from this location, if it exists.
|
||||
// If rollup cannot be found, this is an error.
|
||||
let p = path.dirname(sourceFile.fileName);
|
||||
let checkedPaths = [];
|
||||
let match: RollupMatchInfo;
|
||||
|
||||
while (p.startsWith(process.cwd())) {
|
||||
if (globalGlobalRollupMap.has(p)) {
|
||||
// We already resolved for this directory, just return it.
|
||||
match = globalGlobalRollupMap.get(p);
|
||||
break;
|
||||
}
|
||||
|
||||
const allFiles = fs.readdirSync(p);
|
||||
const maybeRollupPath = allFiles.find(x => _isRollupPath(path.join(p, x)));
|
||||
if (maybeRollupPath) {
|
||||
const rollupFilePath = path.join(p, maybeRollupPath);
|
||||
const rollupConfig = require(rollupFilePath);
|
||||
match = {filePath: rollupFilePath, globals: rollupConfig && rollupConfig.globals};
|
||||
|
||||
// Update all paths that we checked along the way.
|
||||
checkedPaths.forEach(path => globalGlobalRollupMap.set(path, match));
|
||||
globalGlobalRollupMap.set(rollupFilePath, match);
|
||||
break;
|
||||
}
|
||||
|
||||
checkedPaths.push(p);
|
||||
p = path.dirname(p);
|
||||
}
|
||||
if (!match) {
|
||||
throw new Error(
|
||||
`Could not find rollup.config.js for ${JSON.stringify(sourceFile.fileName)}.`);
|
||||
}
|
||||
|
||||
const rollupFilePath = match.filePath;
|
||||
const globalConfig = match.globals || Object.create(null);
|
||||
|
||||
return allImports
|
||||
.map(importStatement => {
|
||||
const modulePath = (importStatement.moduleSpecifier as ts.StringLiteral).text;
|
||||
if (modulePath.startsWith('.')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (importsWhitelist.indexOf(modulePath) != -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const [re, arr] of packageScopedImportWhitelist) {
|
||||
if (re.test(sourceFile.fileName) && arr.indexOf(modulePath) != -1) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(modulePath in globalConfig)) {
|
||||
return new RuleFailure(
|
||||
sourceFile, importStatement.getStart(), importStatement.getWidth(),
|
||||
`Import ${JSON.stringify(modulePath)} could not be found in the rollup config ` +
|
||||
`at path ${JSON.stringify(rollupFilePath)}.`,
|
||||
this.ruleName);
|
||||
}
|
||||
|
||||
return null;
|
||||
})
|
||||
.filter(x => !!x);
|
||||
}
|
||||
}
|
|
@ -18,7 +18,6 @@
|
|||
"no-jasmine-focus": true,
|
||||
"no-var-keyword": true,
|
||||
"require-internal-with-underscore": true,
|
||||
"rollup-config": true,
|
||||
"semicolon": [
|
||||
true
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue