jhthorsen / mojolicious-plugin-webpack

Integrate your mojo app with webpack
13 stars 7 forks source link

Refactor code into Mojo::Alien:: namespace #13

Closed jhthorsen closed 3 years ago

jhthorsen commented 3 years ago

This PR completely changes the internals of Mojolicious::Plugin::Webpack by replacing Mojolicious::Plugin::Webpack::Builder with Mojo::Alien::npm and Mojo::Alien::webpack.

This is a pretty big change, so here are some highlights:

  1. Add Mojo::Alien::npm to run "npm". This module can init a nodejs repo, install dependencies and return information about dependencies.
  2. Add Mojo::Alien::webpack. This module can init and build a webpack project. It has most of the functionality that Mojolicious::Plugin::Webpack::Builder used to have, but it's more focused.
  3. Mojolicious::Plugin::Webpack is rewritten to use Mojo::Alien::webpack as "engine". It will also use the information from Mojo::Alien::webpack::asset_map() instead of parsing the a generated HTML file in public/asset/.
  4. A bunch of files have been deleted since they are not longer in use.
  5. Mojo::Alien::webpack::asset_map() also tracks images and other assets, which solves #12.