Releases: browserify/static-module
Release list
v3.0.4
v3.0.3
Fix npm audit warning, thanks @jimmywarting!
v3.0.0
Implement scope tracking.
The core idea is this:
var fs = require('fs')
fs.readFileSync('./a.txt') // refers to require('fs'), is replaced
function whatever (fs) {
fs.readFileSync() // different fs variable, is _not_ replaced
}Additionally, the require call for a module will be kept if some of its uses in the file could not be replaced. For example, with fs:
var fs = require('fs')
fs.readFileSync(__filename)Here, require('fs') will be removed because the fs.readFileSync call is statically evaluated and replaced.
var fs = require('fs')
fs.readFileSync(__filename)
fs.readFile(someUserInput)Here, the fs.readFileSync() call is statically evaluated and replaced, but the fs.readFile call is not because it requires a runtime value someUserInput. In this case, the require('fs') call is kept.
v2.2.5
Fix a rare bug that could cause statically evaluated content to interfere with surrounding code. See #14.
v2.2.4
v2.2.3
- Fix source maps for files that do not contain any static module
require()s (#44)
v2.2.2
v2.2.1
Only parse files if they contain a target module. (#20)
v2.2.0
Generate source maps (#40)
Pass sourceMap: true to generate inline source maps.
v2.1.1
catch errors in statically evaluated expressions so the process does not crash