How to order angular-cli-scripts

My angular-cli.json has the following:

 ... "scripts": [ ... "../node_modules/jquery-ui/ui/widget.js", "../node_modules/jquery-ui/ui/widgets/datepicker.js", "../node_modules/jquery-ui-timepicker-addon/dist/jquery-ui-timepicker-addon.js", ... ], ... 

At https://github.com/trentrichardson/jQuery-Timepicker-Addon/blob/master/dist/jquery-ui-timepicker-addon.js#L15 I get Uncaught TypeError: Cannot read property 'timepicker' of undefined . I found this because webpack loads the scripts in the following order:

jquery-ui-timepicker-addon.js
widget.js
datepicker.js

widget.js must be downloaded before jquery-ui-timepicker-addon.js . Why is the webpack dose not loading in the same order as in the configuration, and how do you determine the file upload order?

+7
angular webpack angular-cli
source share
2 answers

This is not supported at the moment (since beta 24).

You will probably need to open a new Github problem to maintain the order of the scripts according to the configuration of angular-cli.json .

Another option you can try is to import files from TypeScript.

0
source share

Scripts are loaded in the order in which they are in angular-cli.json , Uncaught TypeError: Cannot read property 'timepicker' of undefined executed the $.ui command defined in jquery-ui/ui/version.js not jquery-ui/ui/widget.js .

My mistake.

... while it looks like they are loaded in the wrong order due to numbers, they are loading in the correct order ... https://github.com/angular/angular-cli/issues/3782#issuecomment-269883288

0
source share

All Articles