rmrevin / yii2-minify-view

Yii2 View component with minification css & js
MIT License
191 stars 67 forks source link

Duplicating js #24

Closed sdlins closed 8 years ago

sdlins commented 8 years ago

Hi,

I have an AssetBundle (AB) on Head position (3 css and 1 js) and another one on End position (0 css and 15 js) in certain page. Whe using this extension, all the js files from both AB are mixed up in only one file and placed in the both html positions. I mean that in Head i have 1 file minified (1 + 15 = 16 js) and in the End i have the same file.

What should be the result? One js file in the head with just 1 minified js file and a different file in the end with 15 minified js files.

My relevant config:

'js_position' => [\yii\web\View::POS_HEAD, \yii\web\View::POS_END], // positions of js files to be minified

My relevant resulting html:

<head>
...
<script src="/clientes/sg2/public_html/frontend/web/minify/da39a3ee5e6b4b0d3255bfef95601890afd80709.js">
...
</head>
<body>
.....
....
<script src="/clientes/sg2/public_html/frontend/web/minify/da39a3ee5e6b4b0d3255bfef95601890afd80709.js">
</body>
...

What is wrong? And what could I do to help?

rmrevin commented 8 years ago

Show the bundles and how you connect. Just checked in version 1.9.1 everything works correctly. p.s. I'm sorry for the long answer. Missed notice.