Skip to content

Commit

Permalink
Use replace to set production
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiiks committed Mar 7, 2019
1 parent e5239d9 commit c467094
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* LICENSE file in the root directory of this source tree.
*/

/*PRODUCTION*/
const TESTS = typeof PRODUCTION === 'undefined';
const TEST_ARGS = () => {
const _basePath = path.resolve(__dirname, '..', '..');
Expand Down
5 changes: 3 additions & 2 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import del from 'del';
import copy from 'gulp-copy';
import rename from 'gulp-rename';
import inject from 'gulp-inject-string';
import replace from 'gulp-replace';
import copydeps from './scripts/copydeps';
import file from 'gulp-file';
import editjson from 'gulp-json-editor';
Expand All @@ -17,7 +18,7 @@ import editorpkg from './editor/package';
gulp.task('core-main', function () {
return pump([
gulp.src('core/dist/main.js'),
inject.after(`'use strict';\n`, 'const PRODUCTION = true;\n'),
replace('/*PRODUCTION*/', 'const PRODUCTION = true;'),
rename(`core.${corepkg.version}.js`),
gulp.dest('release/core')
]);
Expand Down Expand Up @@ -144,4 +145,4 @@ gulp.task('del-release', function() {

gulp.task('dependencies', gulp.series('node-modules', gulp.parallel('node-sass-bindings', 'keytar-bindings')));
gulp.task('build-release', gulp.parallel('core-release', 'client-release', 'editor-release', 'dependencies'));
gulp.task('release', gulp.series('del-release', 'build-release'));
gulp.task('release', gulp.series('del-release', 'build-release'));
51 changes: 51 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"gulp-inject-string": "^1.1.2",
"gulp-json-editor": "^2.5.1",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-watch": "^5.0.1",
"hash-files": "^1.1.1",
"html-webpack-plugin": "^3.2.0",
Expand Down

0 comments on commit c467094

Please sign in to comment.