diff --git a/.github/angular-robot.yml b/.github/angular-robot.yml index d8fb52f61f..c79c984a40 100644 --- a/.github/angular-robot.yml +++ b/.github/angular-robot.yml @@ -59,7 +59,6 @@ merge: - "**/package.json" - "**/tsconfig-build.json" - "**/tsconfig.json" - - "**/rollup.config.js" - "**/BUILD.bazel" - "**/*.md" - "packages/**/integrationtest/**" diff --git a/packages/animations/browser/rollup.config.js b/packages/animations/browser/rollup.config.js deleted file mode 100644 index 3ffb6d5a6a..0000000000 --- a/packages/animations/browser/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/animations/browser/testing/rollup.config.js b/packages/animations/browser/testing/rollup.config.js deleted file mode 100644 index 8380bc9d35..0000000000 --- a/packages/animations/browser/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/animations/rollup.config.js b/packages/animations/rollup.config.js deleted file mode 100644 index 5a1aa1f7f2..0000000000 --- a/packages/animations/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/bazel/src/ng_package/BUILD.bazel b/packages/bazel/src/ng_package/BUILD.bazel index ed5307737d..cacb014d35 100644 --- a/packages/bazel/src/ng_package/BUILD.bazel +++ b/packages/bazel/src/ng_package/BUILD.bazel @@ -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", diff --git a/packages/common/http/rollup.config.js b/packages/common/http/rollup.config.js deleted file mode 100644 index c2a589b01f..0000000000 --- a/packages/common/http/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/common/http/testing/rollup.config.js b/packages/common/http/testing/rollup.config.js deleted file mode 100644 index 50ab5a54ee..0000000000 --- a/packages/common/http/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/common/rollup.config.js b/packages/common/rollup.config.js deleted file mode 100644 index ff83e4dbdf..0000000000 --- a/packages/common/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/common/testing/rollup.config.js b/packages/common/testing/rollup.config.js deleted file mode 100644 index 5022ab760e..0000000000 --- a/packages/common/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/compiler-cli/browser-rollup.config.js b/packages/compiler-cli/browser-rollup.config.js deleted file mode 100644 index d5c583c04b..0000000000 --- a/packages/compiler-cli/browser-rollup.config.js +++ /dev/null @@ -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()] -}; diff --git a/packages/compiler/rollup.config.js b/packages/compiler/rollup.config.js deleted file mode 100644 index a735cc2adc..0000000000 --- a/packages/compiler/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/compiler/testing/rollup.config.js b/packages/compiler/testing/rollup.config.js deleted file mode 100644 index a3a7211031..0000000000 --- a/packages/compiler/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js deleted file mode 100644 index 93e50a2578..0000000000 --- a/packages/core/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/core/testing/rollup.config.js b/packages/core/testing/rollup.config.js deleted file mode 100644 index 7166f4aa49..0000000000 --- a/packages/core/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/elements/rollup.config.js b/packages/elements/rollup.config.js deleted file mode 100644 index 477863d15e..0000000000 --- a/packages/elements/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/forms/rollup.config.js b/packages/forms/rollup.config.js deleted file mode 100644 index d4567e15c7..0000000000 --- a/packages/forms/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/http/rollup.config.js b/packages/http/rollup.config.js deleted file mode 100644 index 2557452ef9..0000000000 --- a/packages/http/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/http/testing/rollup.config.js b/packages/http/testing/rollup.config.js deleted file mode 100644 index 7281922084..0000000000 --- a/packages/http/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/language-service/rollup.config.js b/packages/language-service/rollup.config.js deleted file mode 100644 index 7404f938e4..0000000000 --- a/packages/language-service/rollup.config.js +++ /dev/null @@ -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()] -}; diff --git a/packages/platform-browser-dynamic/rollup.config.js b/packages/platform-browser-dynamic/rollup.config.js deleted file mode 100644 index 7c7d2ae005..0000000000 --- a/packages/platform-browser-dynamic/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-browser-dynamic/testing/rollup.config.js b/packages/platform-browser-dynamic/testing/rollup.config.js deleted file mode 100644 index 60e34047f4..0000000000 --- a/packages/platform-browser-dynamic/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-browser/animations/rollup.config.js b/packages/platform-browser/animations/rollup.config.js deleted file mode 100644 index 3faf536738..0000000000 --- a/packages/platform-browser/animations/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-browser/rollup.config.js b/packages/platform-browser/rollup.config.js deleted file mode 100644 index af01efe10f..0000000000 --- a/packages/platform-browser/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-browser/testing/rollup.config.js b/packages/platform-browser/testing/rollup.config.js deleted file mode 100644 index d2424ff7f5..0000000000 --- a/packages/platform-browser/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-server/rollup.config.js b/packages/platform-server/rollup.config.js deleted file mode 100644 index 81f3915684..0000000000 --- a/packages/platform-server/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-server/testing/rollup.config.js b/packages/platform-server/testing/rollup.config.js deleted file mode 100644 index 1dbe00b8b5..0000000000 --- a/packages/platform-server/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-webworker-dynamic/rollup.config.js b/packages/platform-webworker-dynamic/rollup.config.js deleted file mode 100644 index 471ffbe3c9..0000000000 --- a/packages/platform-webworker-dynamic/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/platform-webworker/rollup.config.js b/packages/platform-webworker/rollup.config.js deleted file mode 100644 index 91d8e4a14d..0000000000 --- a/packages/platform-webworker/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/rollup.config.js b/packages/rollup.config.js deleted file mode 100644 index af011b96c2..0000000000 --- a/packages/rollup.config.js +++ /dev/null @@ -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()] -}; diff --git a/packages/router/rollup.config.js b/packages/router/rollup.config.js deleted file mode 100644 index 4bdd65fbd9..0000000000 --- a/packages/router/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/router/testing/rollup.config.js b/packages/router/testing/rollup.config.js deleted file mode 100644 index 2cddeb51a0..0000000000 --- a/packages/router/testing/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/router/upgrade/rollup.config.js b/packages/router/upgrade/rollup.config.js deleted file mode 100644 index 135b0f9349..0000000000 --- a/packages/router/upgrade/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/service-worker/cli/rollup-cli.config.js b/packages/service-worker/cli/rollup-cli.config.js deleted file mode 100644 index c63011679d..0000000000 --- a/packages/service-worker/cli/rollup-cli.config.js +++ /dev/null @@ -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', - ], -}; diff --git a/packages/service-worker/config/rollup.config.js b/packages/service-worker/config/rollup.config.js deleted file mode 100644 index 8aa5eb619c..0000000000 --- a/packages/service-worker/config/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/service-worker/rollup.config.js b/packages/service-worker/rollup.config.js deleted file mode 100644 index c491a87bc5..0000000000 --- a/packages/service-worker/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/service-worker/worker/rollup-worker.config.js b/packages/service-worker/worker/rollup-worker.config.js deleted file mode 100644 index bf8be460f9..0000000000 --- a/packages/service-worker/worker/rollup-worker.config.js +++ /dev/null @@ -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', -}; diff --git a/packages/upgrade/rollup.config.js b/packages/upgrade/rollup.config.js deleted file mode 100644 index c16303ff19..0000000000 --- a/packages/upgrade/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/packages/upgrade/static/rollup.config.js b/packages/upgrade/static/rollup.config.js deleted file mode 100644 index 844143c401..0000000000 --- a/packages/upgrade/static/rollup.config.js +++ /dev/null @@ -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 -}; diff --git a/tools/tslint/rollupConfigRule.ts b/tools/tslint/rollupConfigRule.ts deleted file mode 100644 index e5cfbb086e..0000000000 --- a/tools/tslint/rollupConfigRule.ts +++ /dev/null @@ -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(); - - -export class Rule extends AbstractRule { - public apply(sourceFile: ts.SourceFile): RuleFailure[] { - const allImports = 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); - } -} diff --git a/tslint.json b/tslint.json index 1f29ebb7c8..d12df37dde 100644 --- a/tslint.json +++ b/tslint.json @@ -18,7 +18,6 @@ "no-jasmine-focus": true, "no-var-keyword": true, "require-internal-with-underscore": true, - "rollup-config": true, "semicolon": [ true ],