资产包生成空的 JavaScript 和 CSS 文件
namespace frontend\assets;
return [
'bundles' => [
'frontend\assets\AppAsset',
],
'targets' => [
'frontend\assets\AppAsset' => [
'basePath' => 'e:/path/yii2.loc/www',
'baseUrl' => '',
'js' => 'js/{ts}.js',
'css' => 'css/{ts}.css',
],
],
'assetManager' => [
'basePath' => 'e:/path/yii2.loc/www/assets',
'baseUrl' => '',
],
];
配置文件
return [
'bundles' => [
'frontend\assets\AppAsset',
],
'targets' => [
'frontend\assets\AppAsset' => [
'basePath' => 'e:/path/yii2.loc/www',
'baseUrl' => '',
'js' => 'cache/{ts}.js',
'css' => 'cache/{ts}.css',
],
],
'assetManager' => [
'basePath' => 'e:/path/yii2.loc/www/assets',
'baseUrl' => '',
],
];
然后在控制台
yii asset e:\path\config.php e:\path\compressed.php
//compresed.php it's result file with name of compressed files
并且在配置中
'assetManager' => [
'bundles' => require dirname(__DIR__) . '/assets/compressed.php',
],
CSS 和 JavaScript 文件位于一个目录中:
e:/path/yii2.loc/www/css
和
e:/path/yii2.loc/www/js
捆绑生成空到:
e:/path/yii2.loc/www/cache/css 和 e:/path/yii2.loc/www/cache/js
我做错了什么?