Using webstrom to debug Vue. js single page program method tutorial, webstromvue. js

Source: Internet
Author: User

Using webstrom to debug Vue. js single page program method tutorial, webstromvue. js

Preface

Debugging Vue. js single-page programs using webstrom should theoretically support all applications built with webpack

Webstrom version: 2017.1

Code: Basic single page application built using vue-cli

Modify webpack configurations

Because webpack packs all files together, we need webpack to provide us with a source map.

Change devtool to source-map. This is my Development Configuration File webpack. dev. conf. js.

module.exports = merge(baseWebpackConfig, {  module: { rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) }, // cheap-module-eval-source-map is faster for development devtool: 'source-map', plugins: [ new webpack.DefinePlugin({  'process.env': config.dev.env }), // https://github.com/glenjamin/webpack-hot-middleware#installation--usage new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin(), // https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({  filename: 'index.html',  template: 'index.html',  inject: true }), new FriendlyErrorsPlugin() ]})

Install the browser extension

Install a chrome extension. Click the link to install it.

Https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji/related

Create a debug

Run-> Edit Configurations

Select Javscript Debug

After the URL is filled in, the following directory ing will be displayed.

Run debug

Set the breakpoint and click the bug in the upper-right corner.

The browser will be opened later. When running to the breakpoint location you set, webstrom will be triggered

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.