简体   繁体   中英

layout.js updated after compile sails lift

I have new in sails.js . In layout.js in views files I have script tags like this.

<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.countTo.js"></script>
<script src="/js/jquery.easing.1.3.js"></script>
<script src="/js/jquery.min.js"></script>

If I have changed the file and move the file jquery.min.js to the top and compile usings sails lift . Then my layout.js changed and file remain same.

Every script between

<!--SCRIPTS-->
<!--SCRIPTS END-->

will get modified automatically by the grunt task which will parse your assets folder and put reference to every script it finds there overwriting your file. If you wish to put your script above all else, modify your pipeline.js file in the tasks folder - look for the variable jsFilesToInject and put your jquery.min.js file above all else or just move that file into /js/dependencies/jquery folder in your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM