@pitrix/lego-font

0.0.1 • Public • Published

Lego Fonts

字体类型

Lego-UI 使用的首选字体类型是 RobotoRoboto Mono,由于部分私有云场景下无法连接外网,无法加载外部字体文件,因此建立这个项目来单独存放字体文件与字体相关的样式文件。

使用方法

引入字体文件需要配合 webpack 以及 file-loader 插件一起使用:

安装 file-loader 插件:

npm install file-loader --save-dev

file-loader 插件配置到 webpack.config.js:

module.exports = {
  entry: './src/app.js',
  output: {
    path: __dirname + '/dist',
    filename: 'build.js',
  },
  module: {
    loaders: [
      {
        test: /\.scss$/,
        loader: 'style-loader!css-loader!sass-loader'
      },
      {
        test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
        use: [{
          loader: 'file-loader',
          options: {
            name: '[name].[ext]',
            outputPath: 'fonts/' // config as you like
          }
        }]
      }
    ],
  },
  watch: true,
};

Readme

Keywords

none

Package Sidebar

Install

npm i @pitrix/lego-font

Weekly Downloads

2

Version

0.0.1

License

ISC

Unpacked Size

5.61 MB

Total Files

72

Last publish

Collaborators

  • eivs