Open anchengjian opened 7 years ago
It is completely similar to the fontgen-loader
but with few extra options/fixes that were not there or not merged.
Please see the test
directory in the repo to have brief example about the usage.
The last error might be related to the files
key in the following code example:
module.exports = {
fontName: "Octicons",
files: ["./octicons/svg/*.svg"],
baseClass: "octicon",
classPrefix: "octicon-",
cssFile: 'css'
};
Please provide your snippet of code in config/icon.font.js
module.exports = {
"fontName": "Octicons",
"files": ["assets/icon/*.svg"],
"baseClass": "octicon",
"classPrefix": "octicon-",
"cssFile": "css"
}
ERROR in ./config/icon.font.js
Module build failed: Error: "options.files" is empty.
at webfont (E:/code/node_modules/webfonts-generator/src/index.js:53:41)
at Object.module.exports (E:/code/node_modules/font-gen-loader/index.js:160:5)
@ ./src/main.js 26:0-27
Does any file match the glob pattern assets/icon/*.svg
?
I was able to reproduce the error when there are no files which match to glob pattern. Put some svg
files in assets/icon
to see it working.
@anchengjian try this:
var glob = require("glob").sync;
module.exports = {
fontName: "Octicons",
files: glob("assets/icon/*.svg", {cwd: __dirname}),
...
or simply use JSON config.
1) How to use? 2) Compared to
fontgen-loader
, what changes ?According to the document, I got an error
then I rewrite the
weboack.config
got another error