generator-ko
generator-ko copied to clipboard
Gulp js task fails ("exceeds the max of 100KB")
C:\Users\Hans\web\knockout\hans\tvguide-frontend> gulp [17:25:19] Using gulpfile ~\web\knockout\hans\tvguide-frontend\gulpfile.js [17:25:19] Starting 'html'... [17:25:19] Starting 'js:babel'... [17:25:19] Starting 'css'... [17:25:20] Finished 'html' after 1.18 s [17:25:20] Finished 'css' after 1.55 s [BABEL] Note: The code generator has deoptimised the styling of "src/bower_modules/jquery/dist/jquery.js" as it exceeds the max of "100KB". [BABEL] Note: The code generator has deoptimised the styling of "src/bower_modules/knockout/dist/knockout.debug.js" as it exceeds the max of "100KB". stream.js:74 throw er; // Unhandled stream error in pipe. ^
SyntaxError: src/bower_modules/jquery/src/intro.js: Unexpected token (45:0) 43 | // you try to trace through "use strict" call chains. (#13335) 44 | //"use strict";
45 | | ^ at Parser.pp.raise (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\location.js:24:13) at Parser.pp.unexpected (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\util.js:82:8) at Parser.pp.parseExprAtom (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\expression.js:425:12) at Parser.parseExprAtom (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\plugins\jsx\index.js:412:22) at Parser.pp.parseExprSubscripts (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\expression.js:236:19) at Parser.pp.parseMaybeUnary (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\expression.js:217:19) at Parser.pp.parseExprOps (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\expression.js:163:19) at Parser.pp.parseMaybeConditional (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\expression.js:145:19) at Parser.pp.parseMaybeAssign (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\expression.js:112:19) at Parser.pp.parseExpression (C:\Users\Hans\web\knockout\hans\tvguide-frontend\node_modules\babylon\lib\parser\expression.js:79:19)
Hans I sent a pull request #16 which fixes this problem.
The problem is that jquery is being processed by the babel transpiler when it shouldn't, the "skip" configuration specifies to ignore all scripts in node_modules, these skip configuration strings get regexed and they use forward-slash directory separators which wont match the back-slash directory separators in windows environments; so the skip settings regex do not match and are ignored. By normalizing all paths to use forward-slash directory separators (by using -slash()-) all node_modules scripts are skipped by the babel transpiler and the error is gone.
thanks @nenitiko. You saved the day buddy!
I had to seen this issue,and as this error:The code generator has deoptimised the styling of "xxx/xxx/templates.js as it exceeds the max of 500KB " when a templates.js document was packaged for webpack.So I found some method to resolve it. I know a truthful thing Because we could use the different program frames. You can find gulpfile.js and search the word "babelify", exmaple :
bundler.transform("babelify", { "compact": false,presets: ["es2015"] });
you can see above setting ,I only added "compact":false, Hope to help you.