Comments (3)
@blackgate I'm having trouble reproducing this issue with the latest browserify/babelify/brfs versions.
//script.js
const fs = require('fs')
fs.readFile(__filename, 'utf8', (err, res) => {
if (err) console.error(err)
alert(res)
})
// build.js
const fs = require("fs");
const browserify = require("browserify");
browserify("./script.js", { debug: true })
.transform("babelify", {presets: ["env"], sourceMaps: true})
.transform("brfs")
.bundle()
.pipe(fs.createWriteStream("bundle.js"));
This gives me a bundle.js with the correct source contents:
(left is bundle.js, right is source contents)
Which versions are you using? Or could you make a smallish source file that does reproduce the issue?
from brfs.
I did find and fix another issue here: browserify/static-module#44
But I believe it's different (it doesn't involve the source contents, only mappings)
from brfs.
@goto-bus-stop Sorry, I just had time to check this out today. The problem only seems to happen on files that don't have a require("fs").
the script.js
file is just
import a from './a';
from brfs.
Related Issues (20)
- Deprecation on sourcemap-codec HOT 2
- Possible to include images as base64? HOT 1
- Does not work with var fs = require('fs'), uninitialized;
- UTF with BOM issue HOT 3
- How do I restrict directory traversal?
- ReferenceError: Can't find variable: fs
- Nested require HOT 1
- webpack's watch and hot replace is invalid when use brfs
- brfs replaces require statement but not readFileSync when path is not required HOT 1
- Module build failed: Error: unsupported type for static module: UnaryExpression HOT 1
- Option to retain the native fs module
- Uninitialized Memory Exposure HOT 1
- include `fs.statSync`/`fs.stat`? HOT 1
- Remove compromised dependency static-module HOT 10
- pass ecmaVersion option on to static-module
- Read ArrayBuffer for undefined encoding HOT 3
- Compatibility with Node 15 HOT 1
- Vulnerabilities veracode sca scan
- Still saying fs.readdir is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brfs.