# autofront

> Automation of front-end by Gulp and Bower

Latest version **3.1.5** (published 2026-02-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install autofront
pnpm add autofront
yarn add autofront
bun add autofront
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.1.5 |
| Published | 2026-02-18 |
| First published | 2022-08-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 40 |
| Unpacked size | 23.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Miquel Alejandro Vicens Dalmau |
| Maintainers | mvicens |
| Keywords | angularjs, css, html, javascript, less, pug, scss |

## Links

- npm: https://www.npmjs.com/package/autofront
- Repository: https://github.com/mvicens/autofront
- Homepage: https://github.com/mvicens/autofront#readme
- Issues: https://github.com/mvicens/autofront/issues
- npm.io page: https://npm.io/package/autofront

## Dependencies (40)

- [gulp](https://npm.io/package/gulp.md) 4.0.2
- [sass](https://npm.io/package/sass.md) 1.56.1
- [cssnano](https://npm.io/package/cssnano.md) 5.1.14
- [gulp-pug](https://npm.io/package/gulp-pug.md) 5.0.0
- [gulp-rev](https://npm.io/package/gulp-rev.md) 9.0.0
- [hidefile](https://npm.io/package/hidefile.md) 3.0.0
- [gulp-less](https://npm.io/package/gulp-less.md) 5.0.0
- [gulp-sass](https://npm.io/package/gulp-sass.md) 5.1.0
- [gulp-size](https://npm.io/package/gulp-size.md) 4.0.1
- [gulp-about](https://npm.io/package/gulp-about.md) 1.1.0
- [gulp-babel](https://npm.io/package/gulp-babel.md) 8.0.0
- [gulp-clean](https://npm.io/package/gulp-clean.md) 0.4.0
- [@babel/core](https://npm.io/package/@babel/core.md) 7.20.5
- [gulp-filter](https://npm.io/package/gulp-filter.md) 7.0.0
- [gulp-inject](https://npm.io/package/gulp-inject.md) 5.0.5
- [gulp-notify](https://npm.io/package/gulp-notify.md) 4.0.0
- [gulp-rename](https://npm.io/package/gulp-rename.md) 2.0.0
- [gulp-terser](https://npm.io/package/gulp-terser.md) 2.1.0
- [gulp-useref](https://npm.io/package/gulp-useref.md) 5.0.0
- [autoprefixer](https://npm.io/package/autoprefixer.md) 10.4.13
- [browser-sync](https://npm.io/package/browser-sync.md) 2.27.10
- [delete-empty](https://npm.io/package/delete-empty.md) 2.0.0
- [gulp-htmlmin](https://npm.io/package/gulp-htmlmin.md) 5.0.1
- [gulp-jsonmin](https://npm.io/package/gulp-jsonmin.md) 1.2.0
- [gulp-postcss](https://npm.io/package/gulp-postcss.md) 9.0.1
- [gulp-wiredep](https://npm.io/package/gulp-wiredep.md) 1.2.0
- [get-gulp-args](https://npm.io/package/get-gulp-args.md) 0.0.1
- [gulp-imagemin](https://npm.io/package/gulp-imagemin.md) 7.1.0
- [gulp-purgecss](https://npm.io/package/gulp-purgecss.md) 5.0.0
- [gulp-add-files](https://npm.io/package/gulp-add-files.md) 1.0.0
- [gulp-cssimport](https://npm.io/package/gulp-cssimport.md) 7.0.0
- [gulp-ng-annotate](https://npm.io/package/gulp-ng-annotate.md) 2.1.0
- [gulp-rev-replace](https://npm.io/package/gulp-rev-replace.md) 0.4.4
- [main-bower-files](https://npm.io/package/main-bower-files.md) 2.13.3
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) 7.20.2
- [gulp-load-plugins](https://npm.io/package/gulp-load-plugins.md) 2.0.8
- [gulp-inject-string](https://npm.io/package/gulp-inject-string.md) 1.1.2
- [gulp-angular-filesort](https://npm.io/package/gulp-angular-filesort.md) 1.2.1
- [gulp-rev-delete-original](https://npm.io/package/gulp-rev-delete-original.md) 0.2.3
- [gulp-angular-templatecache](https://npm.io/package/gulp-angular-templatecache.md) 3.0.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 3.1.5 (latest) — 2026-02-18
- 3.1.4 — 2026-01-02
- 3.1.3 — 2026-01-02
- 3.1.2 — 2022-12-17
- 3.1.1 — 2022-12-08
- 3.1.0 — 2022-12-07
- 3.0.1 — 2022-12-02
- 3.0.0 — 2022-12-01
- 2.2.3 — 2022-09-24
- 2.2.2 — 2022-09-18
- 2.2.1 — 2022-09-16
- 2.2.0 — 2022-09-16
- 2.1.1 — 2022-08-21
- 2.1.0 — 2022-08-17
- 2.0.8 — 2022-08-17
- … 28 more at https://npm.io/package/autofront/versions

## README

# Autofront

Automation of front-end by [Gulp](https://gulpjs.com) and [Bower](https://bower.io).

## Get started

### Gulp

Install its CLI (following [the official manual](https://gulpjs.com/docs/en/getting-started/quick-start/) but skipping [the local package](https://gulpjs.com/docs/en/getting-started/quick-start/#install-the-gulp-package-in-your-devdependencies) and the next steps).

And put `gulpfile.js` simply with:

```js
require('autofront');
```

### Bower

[Install it](https://bower.io/#install-bower), [initialize it and save dependencies](https://bower.io/#save-packages).

### Installation

```sh
npm install --save-dev autofront
```

### Source code

Place inside directory `src`; at least including the main page (`index.html`), without embedding tags (`<link>`s and `<script>`s).

### Run

Finally, initiate the project, commanding:

```sh
gulp
```

A browser tab is opened. Now you are ready to develop!

To reach further, see below.

## Usage

### Tasks

The Gulp ones are:

| Name | Details | Processes |
| --- | --- | --- |
| `serve` (default) | Source code runs in a server with live reload. | <ul><li>Bower entry-point files catching.</li><li>Notification and injection of [environment](#environment-variables).</li><li>Compilation (Less, SCSS and Pug)[^1].</li><li>Set up[^2] of HTML5 mode.[^1]</li><li>Insertion of file with app info (`about.json`).</li></ul> |
| `build` | Production code is built (in folder `dist`). | The above and: <ul><li>Templates caching.[^1]</li><li>Concatenation to one hashed file (CSS and JS).</li><li>CSS purging.</li><li>Transform to compatible CSS (Autoprefixer) and JS (Babel).</li><li>Minification (HTML, CSS, JS, images and JSON).</li><li>Console display of files size.</li></ul> |
| `serve:dist` | This distributable application is served but without the refreshing. | The same with the folder hidden. |

[^1]: [If it is on](#settings).
[^2]: Invocation of [`$locationProvider`](https://docs.angularjs.org/api/ng/provider/$locationProvider#html5Mode) and a `<base>` injected.

### Environment variables

They can be used in this way:

1. Define them. Look at [the next section](#settings).
2. Put `AUTOFRONT_ENV` in your JS source code where it would be injected.
3. On executing Gulp command, indicate the name of the current one to the flag argument `env`. Defaults to "development" with server tasks and to "production" with `build`.

## Settings

You can configure it typing into Gulp file like this:

```js
const autofront = require('autofront');

autofront.property = {
	subproperty: value,
	subproperty2: {
		subproperty3: value2,
		// …
	},
	// …
};
autofront.property2.subproperty4 = value3;
// …
```

Defining with:

| Property | Subprop. | <!-- 〃 --> | Type | Details | Default |
| --- | --- | --- | --- | --- | --- |
| `html` | `pug` | | Boolean | [Pug](https://pugjs.org) activated? | `false` |
| `css` | `folder` | | String | Directory that contains CSS files. | `'styles/'` |
| <!-- 〃 --> | `filename` | | String | Filename of root files. | `'index'` |
| <!-- 〃 --> | `order` | | Number | Index of order to include content in stylesheet. | `0` |
| <!-- 〃 --> | `less`[^3] | `order` | Number | Idem for [Less](https://lesscss.org). | `1` |
| <!-- 〃 --> | `scss`[^3] | `order` | Number | Idem for [SCSS (Sass)](https://sass-lang.com/documentation/syntax#scss). | `2` |
| <!-- 〃 --> | <!-- 〃 --> | `variables` | String | Filename of variables file. | `_variables` |
| <!-- 〃 --> | `fonts` | `folder` | String | Location (folder path) of font files from Bower. | `'fonts/'` |
| <!-- 〃 --> | <!-- 〃 --> | `extensions` | String or array of strings | File extensions to catch. | `['eot', 'otf', 'svg', 'ttf', 'woff', 'woff2']` |
| `js` | `ng`[^3] | `module` | String | Name of [AngularJS](https://angularjs.org) main module. | `'app'` |
| <!-- 〃 --> | <!-- 〃 --> | `html5Mode` | Boolean | [HTML5 mode](https://docs.angularjs.org/guide/$location#html5-mode) enabled? | `false` |
| <!-- 〃 --> | <!-- 〃 --> | `template` | Boolean | Templates loaded by [`$templateCache`](https://docs.angularjs.org/api/ng/service/$templateCache)? | `true` |
| <!-- 〃 --> | `envs` | | Object | Environment variables list, with names as keys and data (whatever can be JSON parsed) as values. | `{}` |

[^3]: It can be disabled assigning a falsy value.

## Pending

Fixes and improvements to do:

- Achieve detection of unnamed files (like `.gitkeep`, `.nomedia`…).
- Implement new settings, such as:
  - `js`:
    - Folder (`scripts/`) where to locate source code from Bower (`.tmp`), to avoid conflicts with own files in `src`.
    - Indication about when Babel compilation (during serve or build?).
    - List of CDNs to load.
  - Exclusion folder(s) (whose any files will be forcely treated as "others").
- Settings changes (major releases):
  - All "extra" (not HTML, CSS or JS) languages/libraries defaultly disabled?
  - No CSS preprocessors configured? To activate one, pass info: extension file, Gulp plugin…
- Use [Gulp If](https://www.npmjs.com/package/gulp-if), [Gulp Plumber](https://www.npmjs.com/package/gulp-plumber), [Gulp Newer](https://www.npmjs.com/package/gulp-newer), [Gulp Changed](https://www.npmjs.com/package/gulp-changed), [Gulp Count](https://www.npmjs.com/package/gulp-count)…?
- Support:
  - Markdown (compilation to HTML).
  - [React](https://reactjs.org) (JSX), [Vue](https://vuejs.org)…?
  - [Stylus](https://stylus-lang.com) and other CSS preprocessors?
- Avoid to build distributable CSS if no content?
- Create Gulp task to add new folder with files of template, AngularJS controller and styles in directory `app/`?
- Use [Typrod](https://github.com/mvicens/typrod) as Bower dependency in demo.

---
_Source: https://npm.io/package/autofront · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
