diff --git a/gulpfile.js b/gulpfile.js index d37397da1e..8bce96a8e1 100644 --- a/gulpfile.js +++ b/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']); diff --git a/package-lock.json b/package-lock.json index 48dff422c4..6459b9688d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index a277419f1e..5592e09b0e 100644 --- a/package.json +++ b/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", diff --git a/src/version.json b/src/version.json deleted file mode 100644 index d1992e209e..0000000000 --- a/src/version.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "0.0.0" -} diff --git a/webpack.config.js b/webpack.config.js index 78450dafe3..1d491c835c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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' },