Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to render file vue template in javascript with gulp

gulp.task('bundle-for-dev', function () {
    return browserify({entries: ['./src/js/entry.js']}) // path to your entry file here
    .transform(vueify)
    .plugin('vueify/plugins/extract-css', { out: './tmp/css/bundle.css' }) // path to where you want your css
    .transform(babelify, {"presets": ["es2015"]})
    .external('vue') // remove vue from the bundle, if you omit this line whole vue will be bundled with your code
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(gulp.dest('./tmp/js'));
})
Source by forum.vuejs.org #
 
PREVIOUS NEXT
Tagged: #render #file #vue #template #javascript #gulp
ADD COMMENT
Topic
Name
2+6 =