browserify / browser-unpack Goto Github PK
View Code? Open in Web Editor NEWparse a bundle generated by browser-pack
License: MIT License
parse a bundle generated by browser-pack
License: MIT License
Could you apply the following patch ?
ommit 8ef945dad2a3c5223bf92f1431c6899380593c29 (HEAD -> patched)
Author: Bastien Roucariès <[email protected]>
Date: Wed Sep 1 18:51:22 2021 +0000
Fix buffer deprecation
Replace by correct API
Forwarded
diff --git a/test/multi-byte.js b/test/multi-byte.js
index 7ad4d57..a753098 100644
--- a/test/multi-byte.js
+++ b/test/multi-byte.js
@@ -3,7 +3,7 @@ var unpack = require('../');
var fs = require('fs');
var src = fs.readFileSync(__dirname + '/files/utf-8.js', 'utf8');
-var buf = new Buffer(src);
+var buf = new Buffer.from(src);
test('multi-byte characters', function (t) {
t.plan(6);
Looking for a fix for the for...of
issue 😃
Raising this issue here is probably a total breach of open source etiquette, but I'm doing so as you're a lot more active on this project and the issue on node-falafel has been sitting there for months.
Can you please, please merge https://github.com/substack/node-falafel/pull/29 into falafel and publish a patch. Falafel is a widely used dependency and no-one else can fix the fact that falafel breaks npm shrinkwrap, a serious bug which impacts developers' use of a lot of other npm modules.
The pull request is a very simple update to the package.json which passes Travis CI and shouldn't require much time or effort to review.
Thanks in advance
This is because it's indexing into the buffer with indexes into a UTF-16 string: jquery/esprima#1069
This causes the all the "source" arguments to be shifted over by the difference in "word" count between the UTF-8 and UTF-16 encoding of the string. Took a fair minute to debug, lemme tell ya!
Hi, there :-)
Due to some reasons, I can not leak my js file out for this issue. 😟
Maybe you can give me a little advice about this.
I encounter this error at command line: couldn't parse this bundle
, and after that, clone this repo, do debug to find where throw this error, finally, I find this line, it will return when ast.body.length not equal 1, but here is my ast.body(see the picture below)
There are "ExpressionStatement"
, "IfStatement"
there. Because I know nothing about ast things, but maybe you can give me a advice how to fix this? Thanks in advance.
From debian:
Date: Sat, 11 Nov 2023 21:25:14 +0000
Subject: Depend on acorn instead of node-acorn
---
index.js | 2 +-
package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index bbdd7c1..8656a22 100644
--- a/index.js
+++ b/index.js
@@ -1,4 +1,4 @@
-var parse = require('acorn-node').parse;
+var parse = require('acorn').parse;
module.exports = function (src) {
// If src is a Buffer, esprima will just stringify it, so we beat them to
diff --git a/package.json b/package.json
index 88165e8..0bc9c70 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"browser-unpack": "bin/cmd.js"
},
"dependencies": {
- "acorn-node": "^1.3.0",
+ "acorn": "^8.3.0",
"concat-stream": "^1.5.0",
"minimist": "^1.1.1"
},
I believe browser-unpack
is the cause of smallhelm/unpathify#2
When the code generated in the issue above is run through browser-unpack
programmatically, undefined
is returned. When the code generated in the issue above is run through the CLI, "couldn't parse this bundle" is printed.
For reference, here is what I'm doing to generate the build to run through unpathify
(which in turn uses browser-unpack
which returns undefined
);
package.json
:
{
"name": "build",
"dependencies": {
"lodash": "~2.4.1",
"backbone": "~1.1.2",
"browserify": "~4.1.5"
}
}
client.js
:
require('backbone');
build.js
:
var browserify = require('browserify');
// Construct browserify bundle with client
var b = browserify();
b.add('./client.js');
// Replace underscore with lodash
b.exclude('underscore');
b.require('lodash', {expose: 'underscore'});
// Bundle and write stream
var fs = require('fs');
b.bundle().pipe(fs.createWriteStream('client.build.js'));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.