Javascript requirejs in development but compiled in production

前端 未结 2 1324
甜味超标
甜味超标 2020-12-13 15:32

I\'m beginning to evaluate javascript module tools like RequireJS for javascript modularization. This seems useful, especially during development, so I don\'t need to recomp

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 16:22

    First you have to compile your depency tree into one file using the r compiler. After that you can a striped down AMD loader like almond. At least you have to find a way to change the url in your index html.

    Take a look at gruntjs which can automatize the whole thing, there a bunch task to like usemin that helps you with the process.

提交回复
热议问题