smildlzj / gulp-prepack Goto Github PK
View Code? Open in Web Editor NEWA gulp plugin for prepack
License: MIT License
A gulp plugin for prepack
License: MIT License
I think it's related with facebookarchive/prepack#590
This is likely to do with prepack itself, but I saw a similar issue opened here, so I just wanted to make certain that I am using this gulp plugin properly, or if there may be an issue with it:
Error output:
not an object
TypeError
at unknown:51:40 <- line is below.
at forEach (native)
at hatchListeners (unknown:39:3)
at addListeners (unknown:547:3)
at load (unknown:561:3)
at unknown:948:5
at unknown:540:12
at forEach (native)
at subRoutines (unknown:539:3)
at load (unknown:560:3)
at unknown:502:1
at call (native)
at s (unknown:1:246)
at e (unknown:1:425)
at unknown:1:1
/Users/Salomon/salomonsmeke.github.io/node_modules/prepack/lib/prepack-standalone.js:60
throw new InitializationError();
gulp:
/* produce-source:
* Source production task.
*/
gulp.task('produce-source', () => {
browserify('js/main.js')
.transform(babelify.configure({
presets: ['es2015']
}))
.bundle()
.pipe(source('bundle.js'))
.pipe(buffer())
.pipe(prepack())
//.pipe(replace('"use strict";', ''))
//.pipe(insert.prepend('"use strict";'))
// I dont know why babelify doesnt default to scoping the whole thing as strict.
//.pipe(uglify())
.pipe(gulp.dest('build/js'));
The problem line:
(var node = document.getElementById(id);)
note: id
is in the 40th character position, it is defined within that function as: var id = egg.id;
EDIT: I got past this by defining globals, I am still encountering problems, but Ill close this. Sorry for the inconvenience!
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.