ivanpopelyshev / grunt-jsmin-sourcemap

Grunt task for JSMin with sourcemap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Synopsis

Grunt is a node.js based CLI build tool.

JSMin is a JavaScript minifier that removes whitespace and comments.

Source maps enables developers to view and interact with minified JavaScript as if it were unminified (providing useful line errors and easier debugging).

My point is that *.dev.js file enables developers to add original scripts dynamically in dev mode. That's better than sourcemaps in a few ways.

Documentation

grunt.initConfig({
'jsmin-sourcemap': {
		all: {
			src: ['js/script1.js', 'js/script2.js', 'js/lib/library1.js'],
			dest: 'target-script.js',
			destMap: 'target-script.min.js.map',
			destScript: 'target-script.dev.js'
		}
	}
})

target-script.dev.js :

<script src='js/script1.js'></script>
<script src='js/script2.js'></script>
<script src='js/library1.js'></script>

When you combine all three of these, you get a grunt plugin that is your new best debugging friend.

Demos

The demos in the node-jsmin-sourcemap, what makes this tick, are hosted on Plunker for your testing and enjoyment.

Getting Started

Add this line into your package.json dependencies section

"grunt-jsmin-sourcemap": "git://github.com/ivanpopelyshev/grunt-jsmin-sourcemap"

License

As of Dec 05 2013, Todd Wolfson has released grunt-jsmin-sourcemap and its contents to the public domain.

It has been released under the UNLICENSE.

About

Grunt task for JSMin with sourcemap

License:The Unlicense


Languages

Language:JavaScript 99.9%Language:Shell 0.1%