Webpack webfont style.css和手写笔文件的网页包问题
Im创建一个faststart网页包构建。我使用手写笔+帕格,我需要webfont插件的图标。我需要使用mixin在手写笔文件中@extend一些图标,这就是为什么我需要在main.styl中包含生成的icons.styl。Icons.styl由插件“WebfontPlugin”生成。具有默认手写笔加载程序的手写笔。我将icons.styl放在包含手写笔文件的文件夹中,然后导入它,但出现了一个错误 图标生成代码插件:Webpack webfont style.css和手写笔文件的网页包问题,webpack,stylus,Webpack,Stylus,Im创建一个faststart网页包构建。我使用手写笔+帕格,我需要webfont插件的图标。我需要使用mixin在手写笔文件中@extend一些图标,这就是为什么我需要在main.styl中包含生成的icons.styl。Icons.styl由插件“WebfontPlugin”生成。具有默认手写笔加载程序的手写笔。我将icons.styl放在包含手写笔文件的文件夹中,然后导入它,但出现了一个错误 图标生成代码插件: new WebfontPlugin({ files: path.
new WebfontPlugin({
files: path.resolve(__dirname, "src/svg**/*.svg"),
fontName: "i",
formats: ["woff2"],
template: path.resolve(__dirname, "src/svg/template/icons.styl"),
dest: path.resolve(__dirname, "src/fonts/"),
destTemplate: path.resolve(__dirname, "src/styl/framework"),
}),
触笔选项:
const stylusOptions = {
use: ["nib"],
import: ["nib"],
includeCSS: true,
resolveURL: true,
hoistAtrules: true,
compress: !isDev,
hmr: true,
};
路径:
图标模板-src/svg/template/Icons.styl
主手写笔输入-src/styl/framework/Main.styl
由插件文件生成-src/styl/framework/icons.styl