Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
webpack-webfont
Advanced tools
Changelog
0.0.1-alpha.1 - 2016-10-31
Readme
Webpack plugin for webfont package.
Generating fonts from svg icons using webpack. Support any style (CSS
, SCSS
and own) template.
npm install 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.css
- (required if you passed css
argument) path to file with styles.Feel 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 120 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.