Skip to content

Conversation

@gebeto
Copy link

@gebeto gebeto commented Apr 21, 2018

It is useful for build bundles with webpack or other package managers, if you want to create your own CSS bundle that will consist many css libraries, you can use file-loader

{
  test: /\.(ttf|otf|eot|svg|woff)/,
  use: [{
    loader: 'file-loader',
    options: {
      name: '[name].[ext]',
      outputPath: 'fonts/',		// where the fonts will go
      publicPath: './fonts/'		// override the default path
    }
  }]
}

in your main SCSS file you need to overwrite $devicons-file-path variable, then build will success

Build result without overwriting fonts path:

screen shot 2018-04-21 at 17 06 57

Main SCSS file with overwritten $devicons-file-path variable:

screen shot 2018-04-21 at 17 02 35

Build result:

screen shot 2018-04-21 at 17 06 04

Result is a sindle bundle that consist font-awesome and devicons (and my additional styles):

screen shot 2018-04-21 at 17 09 22

And it's work!

screen shot 2018-04-21 at 17 18 21

tumblr_n2wxgjmnbf1rvf139o1_500

@gebeto gebeto changed the title add variable to change path to fonts directory Add overwrittable variable to change path to fonts directory Apr 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant