/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/core/schematics/rollup.config.js
67 строк
2 KB
SkyZeroZx
docs: update copyright year
07 янв 2026, 20:28
07 янв 2026, 20:28
85ce5f3
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC 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.dev/license */ const {nodeResolve} = require('@rollup/plugin-node-resolve'); const commonjs = require('@rollup/plugin-commonjs'); const {pathPlugin} = require('../../../tools/bazel/rollup/path-plugin.cjs'); /** Removed license banners from input files. */ const stripBannerPlugin = { name: 'strip-license-banner', transform(code, _filePath) { const banner = /(\/\*[\!\*]\s+\*\s@license.*?\*\/)/s.exec(code); if (!banner) { return; } const [bannerContent] = banner; const pos = code.indexOf(bannerContent); if (pos !== -1) { const result = code.slice(0, pos) + code.slice(pos + bannerContent.length); return { code: result.trimStart(), map: null, }; } return { code: code, map: null, }; }, }; const banner = `'use strict'; /** * @license Angular v0.0.0-PLACEHOLDER * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */`; const plugins = [ pathPlugin({tsconfigPath: 'packages/core/schematics/tsconfig.json'}), nodeResolve({ jail: process.cwd(), }), stripBannerPlugin, commonjs(), ]; /** @type {import('rollup').RollupOptions} */ const config = { plugins, external: ['typescript', 'tslib', /@angular-devkit\/.+/, /@angular\//], output: { exports: 'auto', chunkFileNames: '[name]-[hash].cjs', entryFileNames: '[name].cjs', banner, }, }; module.exports = config;