DragonsInn / fontgen-loader

Automated webfont generation from SVG icons. Use with WebPack!
125 stars 42 forks source link

webfonts-loader does not generate SCSS files #39

Closed zgstyle closed 7 years ago

zgstyle commented 7 years ago

Hello, I am trying to get scss from it using the following configs: webpack.config.js:

var ROOT = path.resolve(__dirname, 'web/assets/mail');
var config = {
 module: {
       ...
        rules: [
             {
                test: /\.font\.(js|json)$/,
                include: PATH.FONTS,
                use: [
                    { loader: 'css-loader' },
                    { loader: 'sass-loader' },
                    {
                        loader: 'webfonts-loader',
                        options: {
                            fileName: "../fonts/[fontname].[ext]"
                        }
                    }
                ]
            }
    ]
}};
module.exports = config;

and fonticon.font.js:

var path = require('path');
module.exports = {
    css: true,
    cssTemplate: path.resolve('node_modules/webfonts-generator/templates/scss.hbs'),
    files: [
        "./ifi/*.svg"
    ],
    // "dest": "../fonts",
    fontName: "ificons",
    cssFontsUrl: "/assets/mail/fonts/",
    classPrefix: "ifi-",
    baseClass: "ifi",
    fixedWidth: true,
    types: ["ttf", "woff", "woff2"]
};

It generates required .ttf, woff and wooff2 files, but NO SASS.

pankajpatel commented 7 years ago

Wrong place to raise this issue, as it will be answered at actual loader's repo (which you are using): https://github.com/jeerbl/webfonts-loader. Please close this one.

zgstyle commented 7 years ago

Sorry!