chrishasz / spgo

SPGo: A Lightweight, Open Source, SharePoint IDE for Visual Studio Code
https://www.chrishasz.com/spgo
MIT License
60 stars 11 forks source link

Spgo with Webpack #149

Open mr-layco opened 3 years ago

mr-layco commented 3 years ago

Hi,

This isn't really an issue, it's more of a request for information, to see if anyone else has experience using Webpack within a SharePoint environment.

My use case may be a little niche, but if anyone could help in anyway, or point me in another direction where I may be able to get help, I'd be grateful.

My set up is as follows

SharePoint 2013 on premise. I have a blank aspx page, with the default SharePoint c# boilerplate code at the top (no master page used).

I explicitly code with JavaScript, css and html using the SharePoint REST api to post into lists and get data out of lists to populate my pages.

I manually add script/link tags to the page to load in the JavaScript/css files I need to use. This includes the SharePoint files in '_layouts' (for client side peoplepicker for example) and any other scripts I may need.

I may have many aspx pages in a project, with each page being its own mini single page app carrying out a specific purpose, be it a html form to post data into a list, or a dashboard to present data from lists.

I'm aware that my development process is very old fashioned and modular JavaScript is something that's common place, with tools such as Webpack being the go to tool. I've started to research Webpack and it looks like it can do some great things, but I'm struggling to understand it enough to get it to work with my aspx pages.

What I would ideally like to do is develop a number of aspx pages with my JavaScript code inside, and once I am ready to build, have Webpack minify all my files. I would like it to copy my aspx pages and then insert all the minified file links into the built pages.

I've successfully managed to use it with html files (using the htmlwebpackplugin) but the same build process fails when I try to use aspx pages.

I have carried out some research online and cannot really find anything similar to my problem and don't have enough technical experience to resolve this myself.

I appreciate what I'm asking is quite vague, I would be happy to provide further specific details if someone feels they may be able to help.

Thanks for reading. 😊