
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
webpack-webfont
Advanced tools
Webpack plugin for the webfont package.
Generating fonts from svg icons using the webpack. Supported any style (CSS, SCSS and own) of templates.
npm install --save-dev webpack-webfont
For CSS:
@import 'webfont.css';
import WebfontPlugin from '../../Plugin';
import path from 'path';
export default {
entry: path.resolve(__dirname, '../fixtures/entry.js'),
output: {
path: path.resolve(__dirname, '../build'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.css/,
loaders: [
'style',
'css'
]
},
{
test: /\.scss$/,
loaders: [
'style',
'css',
'sass'
]
},
{
loader: 'url-loader',
test: /\.(svg|eot|ttf|woff|woff2)?$/
},
]
},
resolve: {
modulesDirectories: ["web_modules", "node_modules"]
},
plugins: [
new WebfontPlugin({
files: path.resolve(__dirname, '../fixtures/svg-icons/**/*.svg'),
css: true,
cssTemplateFontPath: './fonts/',
dest: {
fontsDir: path.resolve(__dirname, '../fixtures/css/fonts'),
css: path.resolve(__dirname, '../fixtures/css/webfont.css'),
}
})
]
};
For SCSS:
@import 'webfont.scss';
a.avatar {
&::before {
@extend %webfont;
content: $webfont-avatar;
}
}
import WebfontPlugin from '../../Plugin';
import path from 'path';
export default {
entry: path.resolve(__dirname, '../entry.js'),
output: {
path: path.resolve(__dirname, '../build'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.css/,
loaders: [
'style',
'css'
]
},
{
test: /\.scss$/,
loaders: [
'style',
'css',
'sass'
]
},
{
loader: 'url-loader',
test: /\.(svg|eot|ttf|woff|woff2)?$/
},
]
},
resolve: {
modulesDirectories: ["web_modules", "node_modules"]
},
plugins: [
new WebfontPlugin({
files: path.resolve(__dirname, '../svg-icons/**/*.svg'),
css: true,
cssFormat: 'scss',
cssTemplateFontPath: './fonts/',
dest: {
fontsDir: path.resolve(__dirname, '../scss/fonts'),
css: path.resolve(__dirname, '../scss/_webfont.scss'),
}
})
]
};
General options - see webfont options. Some options are required.
dest - (required) generated files.
fontsDir - (required) directory fonts saving.stylesDir - (optional) directory styles saving.outputFilename - (optional) Set the filename of the generated styles fileFeel free to push your code if you agree with publishing under the MIT license.
FAQs
Webpack plugin for webfont package
The npm package webpack-webfont receives a total of 67 weekly downloads. As such, webpack-webfont popularity was classified as not popular.
We found that webpack-webfont demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.