Your project folder is public accept the protected folder where basically all your logic and views reside. Either you can keep it in the same place as your widget views like widget.[css|js] but then you have to publish these files with yii’s assetmanager, this is what the ‘assets’ folder (in your public, top level directory) is for. If you find this too complicated you could make a directory css/ and js/ in your top level directory (where the entry script index.php resides).
From CClientScript.php:
public $scriptMap=array();
058 /**
059 * @var array list of custom script packages (name=>package spec).
060 * This property keeps a list of named script packages, each of which can contain
061 * a set of CSS and/or JavaScript script files, and their dependent package names.
062 * By calling {@link registerPackage}, one can register a whole package of client
063 * scripts together with their dependent packages and render them in the HTML output.
064 *
065 * The array structure is as follows:
066 * <pre>
067 * array(
068 * 'package-name'=>array(
069 * 'basePath'=>'alias of the directory containing the script files',
070 * 'baseUrl'=>'base URL for the script files',
071 * 'js'=>array(list of js files relative to basePath/baseUrl),
072 * 'css'=>array(list of css files relative to basePath/baseUrl),
073 * 'depends'=>array(list of dependent packages),
074 * ),
075 * ......
076 * )
077 * </pre>
078 *
079 * The JS and CSS files listed are relative to 'basePath'.
080 * For example, if 'basePath' is 'application.assets', a script named 'comments.js'
081 * will refer to the file 'protected/assets/comments.js'.
082 *
083 * When a script is being rendered in HTML, it will be prefixed with 'baseUrl'.
084 * For example, if 'baseUrl' is '/assets', the 'comments.js' script will be rendered
085 * using URL '/assets/comments.js'.
086 *
087 * If 'baseUrl' does not start with '/', the relative URL of the application entry
088 * script will be inserted at the beginning. For example, if 'baseUrl' is 'assets'
089 * and the current application runs with the URL 'http://localhost/demo/index.php',
090 * then the 'comments.js' script will be rendered using URL '/demo/assets/comments.js'.
091 *
092 * If 'baseUrl' is not set, the script will be published by {@link CAssetManager}
093 * and the corresponding published URL will be used.
094 *
095 * When calling {@link registerPackage} to register a script package,
096 * this property will be checked first followed by {@link corePackages}.
097 * If a package is found, it will be registered for rendering later on.
098 *
099 * @since 1.1.7
100 */
see ‘depends’ in 1.
If that’s what the wonderful yii framework docs tell you then you better believe it (or file a bug).
By writing some code? Getting all scripts via clientscript and then using your favorite minifying algorithm. Maybe if you’re lucky Yii already has some of this functionality (don’t think so)