Comparing version 0.0.2 to 0.0.3
75
index.js
@@ -21,34 +21,23 @@ var concat = require('concat-stream') | ||
// Fixes uglify warnings from the browserify prelude | ||
var fixSourcemapForPrelude = function (sourcemap, cb) { | ||
// Yeah, this is weird, but we want to use the prelude.js that browserify depends on | ||
var BROWSER_PACK_FILE = path.join(__dirname, 'node_modules', 'browserify', 'node_modules', 'browser-pack', '_prelude.js'); | ||
var fixSourcemapForPrelude = function (sourcemap) { | ||
var consumer = new SMConsumer(sourcemap) | ||
, preludeConsumer | ||
, generator = SMGenerator.fromSourceMap(consumer) | ||
, srcFile = '/node_modules/browserify/node_modules/browser-pack/_prelude.js' | ||
, preludeParsed | ||
, outputMap; | ||
fs.readFile(BROWSER_PACK_FILE, function (err, preludeData) { | ||
if(err) { | ||
return cb(err); | ||
} | ||
// Just map to the minifed version, after all nothing should be going wrong in there | ||
generator.addMapping({ | ||
generated: {line:1, column: 0} | ||
, original: {line:1, column: 0} | ||
, source: srcFile | ||
}); | ||
var consumer = new SMConsumer(sourcemap) | ||
, preludeConsumer | ||
, generator = SMGenerator.fromSourceMap(consumer) | ||
, srcFile = '/node_modules/browserify/node_modules/browser-pack/_prelude.js' | ||
, preludeParsed | ||
, outputMap; | ||
// Add the original prelude file | ||
generator.setSourceContent(srcFile, '(`browser-pack` prelude)'); | ||
preludeData = preludeData.toString(); | ||
outputMap = generator.toString(); | ||
// Just map to the minifed version, after all nothing should be going wrong in there | ||
generator.addMapping({ | ||
generated: {line:1, column: 0} | ||
, original: {line:1, column: 0} | ||
, source: srcFile | ||
}); | ||
// Add the original prelude file | ||
generator.setSourceContent(srcFile, preludeData) | ||
outputMap = generator.toString(); | ||
cb(null, outputMap); | ||
}); | ||
return outputMap; | ||
}; | ||
@@ -131,3 +120,7 @@ | ||
fixSourcemapForPrelude(outBuff.map, function (err, newmap) { | ||
outBuff.map = fixSourcemapForPrelude(outBuff.map); | ||
fs.writeFile(TMP_FILE, outBuff.map, function (err) { | ||
var minBuff; | ||
if(err) { | ||
@@ -137,19 +130,11 @@ return cb(err); | ||
fs.writeFile(TMP_FILE, newmap, function (err) { | ||
var minBuff; | ||
minBuff = uglify.minify(outBuff.code, { | ||
inSourceMap: TMP_FILE, | ||
outSourceMap: 'js/scripts.map', | ||
fromString: true | ||
}); | ||
if(err) { | ||
return cb(err); | ||
} | ||
minBuff.map = enhanceSourcemapWithContent(outBuff.map, minBuff.map); | ||
minBuff = uglify.minify(outBuff.code, { | ||
inSourceMap: TMP_FILE, | ||
outSourceMap: 'js/scripts.map', | ||
fromString: true | ||
}); | ||
minBuff.map = enhanceSourcemapWithContent(outBuff.map, minBuff.map); | ||
cb(minBuff.code, minBuff.map); | ||
}); | ||
cb(minBuff.code, minBuff.map); | ||
}); | ||
@@ -159,2 +144,2 @@ }); | ||
module.exports = minifyify; | ||
module.exports = minifyify; |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"repository": { | ||
@@ -22,4 +22,3 @@ "type": "git", | ||
"source-map": "0.1.x", | ||
"uglify-js": "2.3.x", | ||
"browserify": "latest" | ||
"uglify-js": "2.3.x" | ||
}, | ||
@@ -26,0 +25,0 @@ "scripts": {}, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
5141
112
- Removedbrowserify@latest
- RemovedJSONStream@1.3.5(transitive)
- Removedacorn@7.4.1(transitive)
- Removedacorn-node@1.8.2(transitive)
- Removedacorn-walk@7.2.0(transitive)
- Removedasn1.js@4.10.1(transitive)
- Removedassert@1.5.1(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbn.js@4.12.15.2.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowser-pack@6.1.0(transitive)
- Removedbrowser-resolve@2.0.0(transitive)
- Removedbrowserify@17.0.1(transitive)
- Removedbrowserify-aes@1.2.0(transitive)
- Removedbrowserify-cipher@1.0.1(transitive)
- Removedbrowserify-des@1.0.2(transitive)
- Removedbrowserify-rsa@4.1.1(transitive)
- Removedbrowserify-sign@4.2.3(transitive)
- Removedbrowserify-zlib@0.2.0(transitive)
- Removedbuffer@5.2.1(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedbuiltin-status-codes@3.0.0(transitive)
- Removedcached-path-relative@1.1.0(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcipher-base@1.0.6(transitive)
- Removedcombine-source-map@0.8.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedconsole-browserify@1.2.0(transitive)
- Removedconstants-browserify@1.0.0(transitive)
- Removedconvert-source-map@1.1.3(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcreate-ecdh@4.0.4(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedcreate-hmac@1.1.7(transitive)
- Removedcrypto-browserify@3.12.1(transitive)
- Removeddash-ast@1.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddeps-sort@2.0.1(transitive)
- Removeddes.js@1.1.0(transitive)
- Removeddetective@5.2.1(transitive)
- Removeddiffie-hellman@5.0.3(transitive)
- Removeddomain-browser@1.2.0(transitive)
- Removedduplexer2@0.1.4(transitive)
- Removedelliptic@6.6.1(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedevents@3.3.0(transitive)
- Removedevp_bytestokey@1.0.3(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-assigned-identifiers@1.2.0(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedglob@7.2.3(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhash-base@3.0.5(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedhtmlescape@1.1.1(transitive)
- Removedhttps-browserify@1.0.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.32.0.4(transitive)
- Removedinline-source-map@0.6.3(transitive)
- Removedinsert-module-globals@7.2.1(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjsonparse@1.3.1(transitive)
- Removedlabeled-stream-splicer@2.0.2(transitive)
- Removedlodash.memoize@3.0.4(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedmiller-rabin@4.0.1(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removedmodule-deps@6.2.3(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-browserify@0.3.0(transitive)
- Removedpako@1.0.11(transitive)
- Removedparents@1.0.1(transitive)
- Removedparse-asn1@5.1.7(transitive)
- Removedpath-browserify@1.0.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-platform@0.11.15(transitive)
- Removedpbkdf2@3.1.2(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedprocess@0.11.10(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedpublic-encrypt@4.0.3(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedqs@6.13.1(transitive)
- Removedquerystring-es3@0.2.1(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedrandomfill@1.0.4(transitive)
- Removedread-only-stream@2.0.0(transitive)
- Removedreadable-stream@2.3.83.6.2(transitive)
- Removedresolve@1.22.8(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.1.25.2.1(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedshasum-object@1.0.0(transitive)
- Removedshell-quote@1.8.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedstream-browserify@3.0.0(transitive)
- Removedstream-combiner2@1.1.1(transitive)
- Removedstream-http@3.2.0(transitive)
- Removedstream-splicer@2.0.1(transitive)
- Removedstring_decoder@1.1.11.3.0(transitive)
- Removedsubarg@1.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedsyntax-error@1.4.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedtimers-browserify@1.4.2(transitive)
- Removedtty-browserify@0.0.1(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedumd@3.0.3(transitive)
- Removedundeclared-identifiers@1.1.3(transitive)
- Removedurl@0.11.4(transitive)
- Removedutil@0.10.40.12.5(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvm-browserify@1.1.2(transitive)
- Removedwhich-typed-array@1.1.16(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedxtend@4.0.2(transitive)