2

I'm playing with System.import() and ES6, and now I got something like this:

<script type="text/javascript" src="http://project.loc.com/Public/Js/Common/Babel.js"></script>
<script type="text/javascript" src="http://project.loc.com/Public/Js/Common/ES6ModuleLoader.js"></script>
<script>
    System.transpiler = 'babel';
    System.baseUrl = 'http://project.loc.com/';
</script>

When I'm importing an ES6 file, it all goes well, but when I first want to load jQuery, like this:

    System.import('Public/Js/Common/jQuery');

I get an error:

[BABEL] Note: The code generator has deoptimised the styling of "http://project.loc.com/Public/Js/Common/jQuery.js" as it exceeds the max of "100KB".

So It looks like Babel is trying to process this file but it shouldn't since it's not an ES6 file.

Not sure, maybe I'm using the wrong approach.

Any help would be appreciated!

Thank you :)

Leonid Beschastny
  • 50,364
  • 10
  • 118
  • 122
Adrian
  • 1,499
  • 3
  • 19
  • 26
  • so, one way is by using an import statement directly in the first JS file. In HTML I would have System.import('Public/Js/LandingPage/App'); and then in that file import $ from 'Public/Js/Common/JQuery/JQuery'; - that works! – Adrian May 03 '15 at 15:47
  • Well I discovered that I did succeed but when I was loading Less, when I tried JQuery again, still got the same error back :\ – Adrian May 03 '15 at 16:13
  • Okay it looks like I messed up somehow with files... anyways I strictly followed this https://github.com/systemjs/systemjs and now it works okay. – Adrian May 03 '15 at 16:27
  • possible duplicate of [What does "The code generator has deoptimised the styling of \[some file\] as it exceeds the max of "100KB"" mean?](http://stackoverflow.com/questions/29576341/what-does-the-code-generator-has-deoptimised-the-styling-of-some-file-as-it-e) – Mackie Messer May 21 '15 at 23:32
  • possible duplicate of [grunt babel 100 kb styling issue](http://stackoverflow.com/questions/31690481/grunt-babel-100-kb-styling-issue) – Mark Rousskov Aug 03 '15 at 22:09

0 Answers0