samdark / yii2-cookbook

Yii 2.0 Community Cookbook
1.45k stars 296 forks source link

Webpack + Yii2 #160

Open resurtm opened 7 years ago

resurtm commented 7 years ago

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.

samdark commented 7 years ago

Great! Looking forward to it.

ihipop commented 7 years ago

any update?

samdark commented 7 years ago

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

antonmarin commented 7 years ago

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

naffiq commented 7 years ago

@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.

pgaultier commented 7 years ago

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.