gulp postdist tasks for version file
This commit is contained in:
parent
58818dabc5
commit
c1efe268d0
12
gulpfile.js
12
gulpfile.js
|
@ -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']);
|
||||
|
|
|
@ -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",
|
||||
|
|
20
package.json
20
package.json
|
@ -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",
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"version": "0.0.0"
|
||||
}
|
|
@ -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' },
|
||||
|
|
Loading…
Reference in New Issue