samdark / yii2-cookbook

Yii 2.0 Community Cookbook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webpack + Yii2

resurtm opened this issue · comments

Would be nice to show people and potential users on how Yii2 could be used in conjunction with Webpack. Webpack is considered as much better way of the application assets handling compared to Yii2 native assets manager, Gulp, Grunt, etc. I'm working on this. Would be done in this or next week. Just created a dedicated issue for my future PR. Additional feature requests and advises are welcome, if there are any of them. ;-)

Directly or indirectly related: #105, #116, #107.

Great! Looking forward to it.

any update?

No since I'm still had no chance to really use webpack.

https://github.com/rkit/bootstrap-yii2
There is the project with webpack integration

@antonmarin great!
The only thing that it uses webpack 1.x, which is already deprecated. And bower-webpack-plugin hasn't been updated for webpack 2.x and extract-text-webpack-plugin still has a lot of bugs for the second version.
I think it's better to wait for updates for those packages (at least for extract-text), before adding webpack guides to cookbook.

Hi, perhaps you can have a look at the thin wrapper I created: https://github.com/pgaultier/yii2-webpack
I created it with typescript in mind but you can tune the webpack.config.js to fit your needs.