webpack-webfont
Webpack plugin for the webfont package.
Generating fonts from svg icons using the webpack. Supported any style (CSS
, SCSS
and own) of templates.
Install
npm install --save-dev webpack-webfont
Usage
For CSS
:
;
;; entry: path output: path: path filename: 'bundle.js' module: loaders: test: /\.css/ loaders: 'style' 'css' test: /\.scss$/ loaders: 'style' 'css' 'sass' loader: 'url-loader' test: /\.?$/ resolve: modulesDirectories: "web_modules" "node_modules" plugins: files: path css: true cssTemplateFontPath: './fonts/' dest: fontsDir: path css: path ;
For SCSS
:
; a.avatar
;; entry: path output: path: path filename: 'bundle.js' module: loaders: test: /\.css/ loaders: 'style' 'css' test: /\.scss$/ loaders: 'style' 'css' 'sass' loader: 'url-loader' test: /\.?$/ resolve: modulesDirectories: "web_modules" "node_modules" plugins: files: path css: true cssFormat: 'scss' cssTemplateFontPath: './fonts/' dest: fontsDir: path css: path ;
Options
-
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 file
Related
- webfont - api for this package.
Contribution
Feel free to push your code if you agree with publishing under the MIT license.