Skip to content

Commit

Permalink
Fix icon font generation
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv authored and Backportbot committed Dec 10, 2019
1 parent 9c083d1 commit ccbd97b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ const { VueLoaderPlugin } = require('vue-loader')
const StyleLintPlugin = require('stylelint-webpack-plugin')

const IconfontPlugin = require('iconfont-plugin-webpack')
const IconfontName = 'iconfont-vue'

const { DefinePlugin } = require('webpack')

// scope variable
const md5 = require('md5')
const PACKAGE = require('./package.json')
const SCOPE_VERSION = JSON.stringify(md5(PACKAGE.version).substr(0, 7))
const appVersion = JSON.stringify(process.env.npm_package_version)
const versionHash = md5(appVersion).substr(0, 7)
const SCOPE_VERSION = JSON.stringify(versionHash)
const ICONFONT_NAME = `iconfont-vue-${versionHash}`

console.info('This build version hash is', versionHash, '\n')

module.exports = {
entry: {
Expand Down Expand Up @@ -98,10 +101,10 @@ module.exports = {
plugins: [
new IconfontPlugin({
src: './src/assets/iconfont',
family: IconfontName,
family: ICONFONT_NAME,
dest: {
font: './src/fonts/[family].[type]',
css: './src/fonts/scss/[family].scss'
css: './src/fonts/scss/iconfont-vue.scss'
},
watch: {
pattern: './src/assets/iconfont/*.svg'
Expand Down

0 comments on commit ccbd97b

Please sign in to comment.