vscode - Is there a way to see a preview of a webpage? -
i wondering if there way see preview of webpage page working on in web browser directly visual studio code editor, instead of having click file make open default web browser.
you can open visual studio code project in browser window configuring gulp task node module gulp-open. can run gulp task inside visual studio code.
here's how might configure gulp task:
var open = require('gulp-open'); gulp.task('browser', function(){ // define source match file wish open: gulp.src('./www/index.html') // designate browser wish file opened in: .pipe(open('<%file.path%>', {app: 'google-chrome'})); }); });
since we've named our task "browser", inside visual studio code can hit command/control p bring command pallet , type task. start type browser. should see code complete full task type. hit return , open file in browser designate. once browser open, can resize , visual studio code side side. work can refresh browser see changes.
you can consult docs gulp-open on npm.
Comments
Post a Comment