combine javascript files at deployment in python

后端 未结 6 2078
一向
一向 2021-01-30 07:41

I\'m trying to reduce the number of scripts included in our website and we use buildout to handle deployments. Has anybody successfully implemented a method of combining and com

6条回答
  •  旧巷少年郎
    2021-01-30 08:21

    The qooxdoo project comes with a Javascript compressor written in Python. Although it's tightly integrated with the framework, you should be able to utilize the compressor component. If you get the latest SDK there is a tool/bin/compile.py command line tool you can use to compress JS files, with various options (use the -h command line switch for help). I'm sure builtout can call this through a shell.

    If you want to roll your own you can draw the compressor into your own Python code, by using the Python modules that come with the qooxdoo SDK (under tool/pylib/). It's not documented but you can look at the compile.py script how to achieve that.

提交回复
热议问题