Giter Site home page Giter Site logo

grunt-map2map's Introduction

grunt-map2map

Map one source map to another source map. Why would you want this? Lets say...

  • Compile some Typescript to JavaScript and generate a source map
  • Run compiled JavaScript through Closure Compiler and generate another source map
  • Remap the source map for the obfuscated code back to the original Typescript

Before Use

  • grunt-contrib-uglify already accomplishes this with its sourceMapIn option. Only use this task for cases that do not already have this functionality.
  • This module does not fix any of the problems with source maps generated along with Closure Compiler's ADVANCED_OPTIMIZATIONS. With this option, Closure Compiler can rewrite source so far beyond the original version, that mapping becomes virtually impossible.

Install

npm install grunt-map2map --save-dev

Options

  • sourceMappingURL: string Value to append as sourceMappingURL to generated source file
  • generated: string The location of the source map to remap to original
  • original: string The location of the source map that generated will remap to
  • dest: string The location to save the remapped source map, defaults to generated

Example

grunt.initConfig({
	map2map: {
		options: {
			sourceMappingURL: 'main.final.js.map'
		},
		main: {
			options: {
				generated: 'bin/main.obfuscated.js.map',
				original: 'bin/main.compiled.js.map',
				dest: 'bin/main.final.js.map'
			}
		}
	}
});

grunt-map2map's People

Watchers

 avatar  avatar

Forkers

gruntjs-updater

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.