gulp postdist tasks for version file

This commit is contained in:
Kyle Spearrin 2018-07-21 00:11:55 -04:00
parent 58818dabc5
commit c1efe268d0
5 changed files with 24 additions and 15 deletions

View File

@ -1,8 +1,12 @@
const gulp = require('gulp');
const googleWebFonts = require('gulp-google-webfonts');
const del = require('del');
const package = require('./package.json');
const fs = require('fs');
const paths = {
src: './src/',
build: './build/',
cssDir: './src/css/',
};
@ -20,6 +24,12 @@ function webfonts() {
.pipe(gulp.dest(paths.cssDir));
};
function version() {
fs.writeFileSync(paths.build + 'version.json', '{"version":"' + package.version + '"}');
}
gulp.task('clean', clean);
gulp.task('webfonts', ['clean'], webfonts);
gulp.task('build', ['webfonts']);
gulp.task('prebuild', ['webfonts']);
gulp.task('version', version);
gulp.task('postdist', ['version']);

3
package-lock.json generated
View File

@ -2569,6 +2569,9 @@
"is-obj": "1.0.1"
}
},
"duo_web_sdk": {
"version": "git+https://github.com/duosecurity/duo_web_sdk.git#7de73ecb6594182600601d4e4d29bd2869271287"
},
"duplexer2": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz",

View File

@ -6,16 +6,16 @@
"sub:update": "git submodule update --remote",
"sub:pull": "git submodule foreach git pull",
"postinstall": "npm run sub:init",
"build": "gulp build && webpack --config webpack.config.js",
"build:watch": "gulp build && webpack-serve --config webpack.config.js",
"build:prod": "gulp build && cross-env NODE_ENV=production webpack --config webpack.config.js",
"build:prod:watch": "gulp build && cross-env NODE_ENV=production webpack-serve --config webpack.config.js",
"build:selfhost": "gulp build && cross-env SELF_HOST=true webpack-serve --config webpack.config.js",
"build:selfhost:watch": "gulp build && cross-env SELF_HOST=true webpack-serve --config webpack.config.js",
"build:selfhost:prod": "gulp build && cross-env SELF_HOST=true NODE_ENV=production webpack --config webpack.config.js",
"build:selfhost:prod:watch": "gulp build && cross-env SELF_HOST=true NODE_ENV=production webpack-serve --config webpack.config.js",
"dist": "npm run build:prod",
"dist:selfhost": "npm run build:selfhost:prod",
"build": "gulp prebuild && webpack --config webpack.config.js",
"build:watch": "gulp prebuild && webpack-serve --config webpack.config.js",
"build:prod": "gulp prebuild && cross-env NODE_ENV=production webpack --config webpack.config.js",
"build:prod:watch": "gulp prebuild && cross-env NODE_ENV=production webpack-serve --config webpack.config.js",
"build:selfhost": "gulp prebuild && cross-env SELF_HOST=true webpack-serve --config webpack.config.js",
"build:selfhost:watch": "gulp prebuild && cross-env SELF_HOST=true webpack-serve --config webpack.config.js",
"build:selfhost:prod": "gulp prebuild && cross-env SELF_HOST=true NODE_ENV=production webpack --config webpack.config.js",
"build:selfhost:prod:watch": "gulp prebuild && cross-env SELF_HOST=true NODE_ENV=production webpack-serve --config webpack.config.js",
"dist": "npm run build:prod && gulp postdist",
"dist:selfhost": "npm run build:selfhost:prod && gulp postdist",
"deploy": "npm run build:prod",
"deploy:preview": "npm run dist && gh-pages -d build -r git@github.com:kspearrin/web-preview.git",
"lint": "tslint src/**/*.ts || true",

View File

@ -1,3 +0,0 @@
{
"version": "0.0.0"
}

View File

@ -97,7 +97,6 @@ const plugins = [
new CopyWebpackPlugin([
{ from: './src/manifest.json' },
{ from: './src/favicon.ico' },
{ from: './src/version.json' },
{ from: './src/browserconfig.xml' },
{ from: './src/app-id.json' },
{ from: './src/images', to: 'images' },