Hi,
I’ve created a new Yii2 based project and I’m facing a strange problem, none of the core JS files are being published, even though there are empty subfolders inside my <web>/assets folder.
I my main config I’m replacing JQuery and Bootstrap’s JS files but aside from that, I don’t think I’ve changed anything related to the AssetsBundle, even my own Bundle is just a list of JS/CSS files, nothing special. I’m using file and database schema cache but on dev I have it disabled. Any thoughts on what can be the problem? Bellow are my configs.
As an example, I this URL is correct, but the JS file isn’t in the folder (it is empty): localhost:8080/aval-it/assets/27650612/yii.js
main.php:
//...
'assetManager' => [
'bundles' => [
'yii\web\JqueryAsset' => [
'sourcePath' => null,
'basePath' => '@webroot',
'baseUrl' => '@web',
'js' => ['js/jquery-3.1.1.min.js']
],
'yii\bootstrap\BootstrapAsset' => [
'sourcePath' => null,
'basePath' => '@webroot',
'baseUrl' => '@web',
'js' => ['js/bootstrap.min.js'],
'css' => ['css/bootstrap.min.css']
],
'yii\bootstrap\BootstrapPluginAsset' => [
'js' => [],
'css' => []
]
]
]
//...
composer.json
...
"require": {
"php": ">=5.6.27",
"yiisoft/yii2": "~2.0",
"yiisoft/yii2-bootstrap": "~2.0",
"kartik-v/yii2-krajee-base": "*",
"kartik-v/yii2-widget-fileinput": "*"
},
"require-dev": {
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*",
"codeception/base": "*",
"codeception/verify": "*"
},
"config": {
"process-timeout": 1800
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject"
]
},
"extra": {
"yii\\composer\\Installer::postCreateProject": {
"setPermission": [
{
"aval-it/it/runtime": "0777",
"aval-it/console/runtime": "0777",
"web/it/assets": "0777",
"ava-it/yii": "0755"
}
]
},
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
...
Regards,
Knitter