
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@unic/estatico-font-datauri
Advanced tools
Uses `gulp-simplefont64` to inline font files into base64-encoded data URIs
Uses gulp-simplefont64
to inline font files into base64-encoded data URIs
$ npm install --save-dev @unic/estatico-font-datauri
const gulp = require('gulp');
const env = require('minimist')(process.argv.slice(2));
/**
* CSS font inlining task
* Uses `gulp-simplefont64` to inline font files into base64-encoded data URIs
*
* Using `--watch` (or manually setting `env` to `{ watch: true }`) starts file watcher
* When combined with `--skipBuild`, the task will not run immediately but only after changes
*/
gulp.task('css:fonts', () => {
const task = require('@unic/estatico-font-datauri');
const instance = task({
src: [
'./src/assets/fonts/**/*',
],
dest: './src/assets/.tmp',
plugins: {
concat: 'fonts.scss',
},
watch: {
src: [
'./src/assets/fonts/**/*',
],
name: 'css:fonts',
},
}, env);
// Don't immediately run task when skipping build
if (env.watch && env.skipBuild) {
return instance;
}
return instance();
});
Run task (assuming the project's package.json
specifies "scripts": { "gulp": "gulp" }
):
$ npm run gulp css:fonts
See possible flags specified above.
plugin(options, env)
=> taskFn
Type: Object
Default: null
Each property is passed to gulp.src
, the key is used for the generated sprite's name.
Type: String
Default: null
Passed to gulp.dest
.
Type: Object
Default: null
Passed to file watcher when --watch
is used.
Type: Object
Type: String
Default: null
Passed to gulp-concat
.
Type: Function
Default: null
Result will be assigned to file.path
before passing the file to gulp-simplefont64
. This allows you to optionally generate file names which can be handled by the plugin (e.g. FontFamily-FontStyle
).
Type: { info: Function, debug: Function, error: Function }
Default: Instance of estatico-utils
's Logger
utility.
Set of logger utility functions used within the task.
Type: Object
Default: {}
Result from parsing CLI arguments via minimist
, e.g. { dev: true, watch: true }
. Some defaults are affected by this, see above.
Apache 2.0.
FAQs
Uses `gulp-simplefont64` to inline font files into base64-encoded data URIs
We found that @unic/estatico-font-datauri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.