debug-comments-loader

A simple webpack-loader, that turns javascript-singel-line-comments into debuging tools.

It will make the following code...

var pi2 = square ( Math . PI )

...print this in the console

9 . 869604401089358 is PI squared .

Installation

npm install -- save - dev debug - comments - loader

Usage

It's recommended to only use it when importing the files that you are currently working with

var stuff = require ( ' debug-comments-loader!stuff.js ' )

But it can as well be used with a regex in the webpack.config.js

{ module : { loaders : [ { test : / \. js $ / , loader : " debug-comments-loader " } ] } }

Then it's just to add your one line comments like this:

var someJavascriptCode = " whatever " function someFunction ( ) { return " whatever " }

Use a differnt logging command

Just name a different logger function in the webpack-query-string

var stuff = require ( ' debug-comments-loader?console.log!stuff.js ' )

Known issues

All known issues can be solved by moving the comment and/or using block comments instead.

var bestArray = [ bestValue , bestvalue2 ]

( ) = > { }