Skip to content

Commit acd94fe

Browse files
committed
Fixes vuejs#138 Fixes vuejs#162 Optionally apply config
options._flags is not always set when using browserify transformations - version affected: "vueify": "^9.4.0" Example of failure in gulp file ```javascript // package.json gulp.task('all', function() { process.env.NODE_ENV = 'production'; return browserify('./source/js/all.js') .transform(babelify.configure({ presets: ["es2015"]})) .transform(vueify) .bundle() .pipe(source('./js/all.js')) .pipe(buffer()) .pipe(rev()) .pipe(gulp.dest(pub)) .pipe(rev.manifest('./build/rev-manifest.json', { base: '', merge: true })) .pipe(gulp.dest('.')); }); ``` ```bash $ gulp all [19:15:56] Using gulpfile ~/gulpfile.js [19:15:56] Starting 'all'... code/node_modules/vueify/index.js:12 sourceMap: options._flags.debug ^ TypeError: Cannot read property 'debug' of undefined at vueify (code/node_modules/vueify/index.js:12:30) ```
1 parent 80e168a commit acd94fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ module.exports = function vueify (file, options) {
88

99
compiler.loadConfig()
1010
compiler.applyConfig(options)
11-
compiler.applyConfig({
12-
sourceMap: options._flags.debug
13-
})
11+
12+
if (options._flags) {
13+
compiler.applyConfig({
14+
sourceMap: options._flags.debug
15+
})
16+
}
1417

1518
var data = ''
1619
var stream = through(write, end)

0 commit comments

Comments
 (0)