andreypopp / reactify

[DEPRECATED] Browserify transform for JSX (superset of JavaScript used in React library by Facebook)
MIT License
690 stars 68 forks source link

Source map become bigger and bigger (with watchify) #50

Closed yapcheahshen closed 8 years ago

yapcheahshen commented 9 years ago

For an empty index.js , the source map (extracted by exorcist) of first build is 1007 bytes, the source map of second rebuild become 1563 bytes, third rebuild become 12,655, and quickly becomes few megabytes. it seems like "sourcesContent" is including itself recursively.

This happen only in 1.0.0, 0.17.1 is fine. my browserify/watchify setting { cache: {}, packageCache: {}, fullPaths: true, debug:true, builtins: false, commondir: false, detectGlobals: false}

///////////////// first build////////////////// "mappings": "AAAA;ACAA;AACA", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})", "\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtZWQuanMiLCJzb3VyY2VzIjpbIkM6XFwyMDE1XFx0ZXN0bWFwXFxpbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiIl19" ]

///////////////////second build//////////////// "mappings": "AAAA;ACAA;AACA,0NAA0N;AAC1N", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})", "\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtZWQuanMiLCJzb3VyY2VzIjpbIkM6XFwyMDE1XFx0ZXN0bWFwXFxpbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiIl19\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtZWQuanMiLCJzb3VyY2VzIjpbIkM6XFwyMDE1XFx0ZXN0bWFwXFxpbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBIiwic291cmNlc0NvbnRlbnQiOlsiXG4vLyMgc291cmNlTWFwcGluZ1VSTD1kYXRhOmFwcGxpY2F0aW9uL2pzb247YmFzZTY0LGV5SjJaWEp6YVc5dUlqb3pMQ0ptYVd4bElqb2lkSEpoYm5ObWIzSnRaV1F1YW5NaUxDSnpiM1Z5WTJWeklqcGJJa002WEZ3eU1ERTFYRngwWlhOMGJXRndYRnhwYm1SbGVDNXFjeUpkTENKdVlXMWxjeUk2VzEwc0ltMWhjSEJwYm1keklqb2lJaXdpYzI5MWNtTmxjME52Ym5SbGJuUWlPbHNpSWwxOSJdfQ==" ] }

cdekok commented 9 years ago

i´m having the same problem

JohnPostlethwait commented 9 years ago

As an addendum to this, it is also source-mapping ALL files that match the default extensions, not just files that really do contain JSX. This duplicates the work Browserify will potentially do with it's source-mapping.

Reactify should ONLY source-map files that had actual JSX in them, not ALL potential files that simply match the extension.

scruffian commented 9 years ago

I don't know if this is connected, but my watchify build times are much slower with version 1.0.0 than 0.17.0