First Steps for Extension development

  • Hey,


    i'm standing infront of a little problem. When i want to create an own extension it's a good practice to use webpack for compiling the vue-files. For doing that it's neccessary to install the dev-dependencies registered in the package.json in the pagekit root directory, right? But, after doing that, pagekit seems to be destroyed as you can see in the screenshot.




    Dou you know what's missing or wrong here?




    There is following error during running webpack from the root directory of a brand new pagekit installation.



    Thanks a lot!

  • Hi there,


    well - you do not have to do anything in your Pagekit-source; if you run webpack on your Pagekit-source, it's possible that you get unwanted results.


    I use to create a separate directory to develop and deploy to my local Pagekit-installation after I ran webpack.


    This is my folder-structure:


    • /var/www/pagekit
    • /home/spqr/projects/... (this deploys to /var/www/pagekit/packages/spqr/...)


    In this case you do only need this:




    And run npm install in your development directory. After doing this you can run webpack there, too.

  • Hey,


    ok. I thought it's pagekits strategy to Run webpack from the root directory. If not so, i will create the package.json in my extensions directory and run npm install there.


    Thanks for advice! It's really an great place to get help for a lot of questions. I really hop the community will grow fast!


    Michael

  • Depending on what you want to do you must also consider which version of webpack is installed. If you want to contribute to some extensions you might must install the older version 1.x instead of the new version 2.x. It once took me some time until I figured out that the webpack errors were due to me using a too new version of webpack :D