Comments (1)
Are you still having this error? Your problem is that your input bundle is not a file. The AST is a list of the statements in your js
file,
for example:
1| console.log("foo");
2|
3| if (window.location !== "bar") {
4| var a = 3;
5| alert(a);
6| }
would return an ast.body of length 2
(one element is an ExpressionStatement
for line 1, one is an IfStatement
for lines 3-6)
A bundle needs to be a single UnaryExprssion
. Specifically, it should looks like the output of browserify or similar
(function e(t,n,r){/*A COUPLE LINES OF MAGIC*/})(
//ALL OF YOUR CODE
);
from browser-unpack.
Related Issues (7)
- browser-unpack's CLI generates invalid source output when stdin contains non-ASCII characters
- Fix buffer warning
- Depends on acorn
- Merge https://github.com/substack/node-falafel/pull/29
- Unable to unpack a Browserify build where one module is replaced with another. HOT 3
- Use acorn for ES6 support? HOT 2
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 browser-unpack.