gulp task for webfonts

This commit is contained in:
Kyle Spearrin 2018-08-08 12:47:54 -04:00
parent 057b684f02
commit 9e7438e0b0
7 changed files with 1613 additions and 103 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ node_modules
npm-debug.log
vwd.webinfo
dist/
css/
*.crx
*.pem
build/

25
gulpfile.js Normal file
View File

@ -0,0 +1,25 @@
const gulp = require('gulp');
const googleWebFonts = require('gulp-google-webfonts');
const del = require('del');
const paths = {
cssDir: './src/css/',
};
function clean() {
return del([paths.cssDir]);
}
function webfonts() {
return gulp.src('./webfonts.list')
.pipe(googleWebFonts({
fontsDir: 'webfonts',
cssFilename: 'webfonts.css',
format: 'woff',
}))
.pipe(gulp.dest(paths.cssDir));
};
gulp.task('clean', clean);
gulp.task('webfonts', ['clean'], webfonts);
gulp.task('prebuild:renderer', ['webfonts']);

2
jslib

@ -1 +1 @@
Subproject commit 3429b57db42a3e1e9948b870bf24fcc02ebc8a99
Subproject commit 4ca7a9709e9ccd0e67ce09309ae605f2057bf089

1660
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,8 +26,8 @@
"lint:fix": "tslint src/**/*.ts --fix",
"build": "concurrently -n Main,Rend -c yellow,cyan \"npm run build:main\" \"npm run build:renderer\"",
"build:main": "webpack --config webpack.main.js",
"build:renderer": "webpack --config webpack.renderer.js",
"build:renderer:watch": "webpack --config webpack.renderer.js --watch",
"build:renderer": "gulp prebuild:renderer && webpack --config webpack.renderer.js",
"build:renderer:watch": "gulp prebuild:renderer && webpack --config webpack.renderer.js --watch",
"electron": "npm run build:main && concurrently -k -n Main,Rend -c yellow,cyan \"electron --inspect=5858 ./build --watch\" \"npm run build:renderer:watch\"",
"clean:dist": "rimraf ./dist/*",
"clean:l10n": "git push origin --delete l10n_master",
@ -202,6 +202,7 @@
"concurrently": "3.5.1",
"copy-webpack-plugin": "^4.2.0",
"css-loader": "^0.28.7",
"del": "^3.0.0",
"electron": "2.0.5",
"electron-builder": "^20.25.0",
"electron-rebuild": "1.8.1",
@ -209,7 +210,8 @@
"extract-text-webpack-plugin": "^3.0.1",
"file-loader": "^1.1.5",
"font-awesome": "4.7.0",
"google-fonts-webpack-plugin": "^0.4.4",
"gulp": "^3.9.1",
"gulp-google-webfonts": "^2.0.0",
"html-loader": "^0.5.1",
"html-webpack-plugin": "^2.30.1",
"node-abi": "^2.4.1",

1
webfonts.list Normal file
View File

@ -0,0 +1 @@
Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext

View File

@ -2,7 +2,6 @@ const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const GoogleFontsPlugin = require("google-fonts-webpack-plugin");
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
@ -84,9 +83,8 @@ const renderer = {
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
publicPath: '../'
}
}]
},
}],
},
{
test: /\.scss$/,
@ -105,19 +103,6 @@ const renderer = {
]
},
plugins: [
new GoogleFontsPlugin({
fonts: [
{
family: 'Open Sans',
variants: ['300', '300italic', '400', '400italic', '600', '600italic',
'700', '700italic', '800', '800italic'],
subsets: ['cyrillic', 'cyrillic-ext', 'greek', 'greek-ext', 'latin', 'latin-ext']
}
],
formats: ['woff2'],
path: 'fonts/',
filename: 'css/fonts.css'
}),
new AngularCompilerPlugin({
tsConfigPath: 'tsconfig.json',
entryModule: 'src/app/app.module#AppModule',