@fomantic/gulp-concat-css

中文文档
5.0.0发布于 2026/07/18近 30 天下载 2.3万

Concatenate css files, rebasing urls and inlining @import

原始使用文档
文档目录5 节
  1. Forked Version using updated dependencies
  2. Install
  3. Examples
  4. API
  5. License

gulp-concat-css

Build Status NPM version Dependency Status Downloads

Forked Version using updated dependencies

Original repo at https://github.com/mariocasciaro/gulp-concat-css

Concatenates css files, bubbling up @import statements (as per the standard), and optionally rebasing urls and inlining local @import statements.

Install

Install with npm.

npm install --save-dev gulp-concat-css

Examples

var gulp = require('gulp');
var concatCss = require('gulp-concat-css');

gulp.task('default', function () {
  return gulp.src('assets/**/*.css')
    .pipe(concatCss("styles/bundle.css"))
    .pipe(gulp.dest('out/'));
});

TIP: for a proper import inlining and url rebase, make sure you set the proper base for the input files.

API

concatCss(targetFile, options)

  • targetFile: The relative path of the generated file containing the concatenated css
  • options: (since 2.1.0)
    • inlineImports: (default true) Inline any local import statement found
    • rebaseUrls: (default true) Adjust any relative URL to the location of the target file.
    • includePaths: (default []) Include additional paths when inlining imports
    • commonBase: (default to the base property of the first file) Common base path from which files and urls resolve

License

MIT @ Mario Casciaro

版本与发布记录

@fomantic/gulp-concat-css 共发布 5 个版本,首次发布于 2022/10/28;过去 12 个月发布了 1 个版本。

版本发布日期距今
5.0.0latest2026/07/183 个月前
4.0.02025/03/011.7 年前
3.3.02025/02/081.8 年前
3.2.12024/05/092 年前
3.2.02022/10/284 年前

关于 @fomantic/gulp-concat-css 的常见问题

@fomantic/gulp-concat-css 是什么?

Concatenate css files, rebasing urls and inlining @import

如何安装 @fomantic/gulp-concat-css?

在项目目录运行 npm install @fomantic/gulp-concat-css,或使用 pnpm add / yarn add / bun add。

@fomantic/gulp-concat-css 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fomantic__gulp-concat-css 是否存在。

@fomantic/gulp-concat-css 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fomantic/gulp-concat-css 可以商用吗?

@fomantic/gulp-concat-css 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@fomantic/gulp-concat-css 的下载量有多少?

根据 npm 官方下载统计,@fomantic/gulp-concat-css 在 2026/10/15 – 2026/11/13 这 30 天内被下载 22,968 次,日均约 766 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fomantic/gulp-concat-css 还在维护吗?

最新版本 5.0.0 发布于 2026/07/18(3 个月前);至今共发布 5 个版本,其中过去 12 个月发布了 1 个;首次发布于 2022/10/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。