Первая версия ссупорта генерации шрифтов из иконок
@ -44,6 +44,7 @@
|
|||||||
"eslint": "^1.10.3",
|
"eslint": "^1.10.3",
|
||||||
"eslint-plugin-react": "^3.13.1",
|
"eslint-plugin-react": "^3.13.1",
|
||||||
"extract-text-webpack-plugin": "^0.9.1",
|
"extract-text-webpack-plugin": "^0.9.1",
|
||||||
|
"fontgen-loader": "^0.1.9",
|
||||||
"html-webpack-plugin": "^1.7.0",
|
"html-webpack-plugin": "^1.7.0",
|
||||||
"imports-loader": "^0.6.4",
|
"imports-loader": "^0.6.4",
|
||||||
"karma": "*",
|
"karma": "*",
|
||||||
|
12
src/components/ui/icons.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import icons from 'icons.font.json';
|
||||||
|
|
||||||
|
const baseClass = 'icon';
|
||||||
|
|
||||||
|
export default Object.keys(icons)
|
||||||
|
.filter((icon) => icon !== baseClass)
|
||||||
|
.reduce((acc, icon) => {
|
||||||
|
acc[icon.replace(`${baseClass}-`, '')] = `${icons[baseClass]} ${icons[icon]}`;
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
;
|
6
src/icons.font.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"files": ["icons/webfont/*"],
|
||||||
|
"fontName": "ely-account-icons",
|
||||||
|
"fixedWidth": true,
|
||||||
|
"normalize": true
|
||||||
|
}
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 628 B |
Before Width: | Height: | Size: 709 B After Width: | Height: | Size: 709 B |
@ -21,7 +21,7 @@ var isTest = process.argv.some(function(arg) {
|
|||||||
return arg.indexOf('karma') !== -1;
|
return arg.indexOf('karma') !== -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
const CSS_LOADER = 'style!css?modules&importLoaders=1&localIdentName=[path][name]-[local]!postcss';
|
const CSS_LOADER = 'style!css?modules&importLoaders=2&localIdentName=[path][name]-[local]!postcss';
|
||||||
|
|
||||||
var webpackConfig = {
|
var webpackConfig = {
|
||||||
entry: {
|
entry: {
|
||||||
@ -107,15 +107,10 @@ var webpackConfig = {
|
|||||||
plugins: ['transform-runtime', ['react-intl', {messagesDir: './dist/messages/'}]]
|
plugins: ['transform-runtime', ['react-intl', {messagesDir: './dist/messages/'}]]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ // DEPRECATED
|
{
|
||||||
test: /i18n\/.*\.less$/,
|
test: /\.font.(js|json)$/,
|
||||||
loader: CSS_LOADER + '!less'
|
|
||||||
},
|
|
||||||
{ // DEPRECATED
|
|
||||||
test: /\.less$/,
|
|
||||||
extractInProduction: true,
|
extractInProduction: true,
|
||||||
exclude: /i18n\/.*\.less$/,
|
loader: CSS_LOADER + '!fontgen?types=woff,eot,ttf'
|
||||||
loader: CSS_LOADER + '!less'
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|