Skip to content

Commit

Permalink
Transpile client-init because it runs on the client in view mode (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
macgyver authored Feb 28, 2020
1 parent 617fe0f commit 0eeeea4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/cmd/compile/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const _ = require('lodash'),
browserify = require('browserify'),
browserifyCache = require('browserify-cache-api'),
babelify = require('babelify'),
babel = require('gulp-babel'),
through2 = require('through2'),
browserifyExtractRegistry = require('browserify-extract-registry'),
browserifyExtractIds = require('browserify-extract-ids'),
Expand Down Expand Up @@ -88,6 +89,7 @@ function buildKiln() {
function copyClientInit() {
return h(gulp.src(path.join(__dirname, '_client-init.js'))
.pipe(changed(destPath, { hasChanged: helpers.hasChanged }))
.pipe(babel(babelConfig))
.pipe(replace('#NODE_ENV#', process.env.NODE_ENV || ''))
.pipe(gulp.dest(destPath))
.pipe(es.mapSync((file) => ({ type: 'success', message: file.path }))));
Expand Down
15 changes: 14 additions & 1 deletion 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 @@ -90,6 +90,7 @@
"get-stdin": "^5.0.1",
"glob": "^7.1.3",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
"gulp-changed": "^3.2.0",
"gulp-concat": "^2.6.1",
"gulp-cssmin": "^0.2.0",
Expand Down

0 comments on commit 0eeeea4

Please sign in to comment.