twgardner2 / navy_psr

1 stars 0 forks source link

Refactor/npm #18

Closed ChaseWPDEV closed 2 years ago

ChaseWPDEV commented 2 years ago

Converted the build process into a npm/webpack workflow to simplify adding packages from the npm universe.

twgardner2 commented 2 years ago

I finally had a couple minutes to sit down and look at this. My web knowledge is apparently very atrophied...trying to figure out what I'm looking at ¯_(ツ)_/¯

ChaseWPDEV commented 2 years ago

Fair Question. This PR is primarily a conversion of the project from a series of enqueued scrip tags, to a Webpack bundle project. Basically, it allows us to do things like npm install , break code into modules, and use SASS (CSS with unobtrusive enhancements), and webpack "transpiles' it into a browser-friendly format without us needing to think too much about it. (but with source maps, so we can still debug it)

This is the gateway to PDF parsing, Easy on Page Data Entry, and generally manageable project growth.

twgardner2 commented 2 years ago

Awesome, sounds amazing.

Either I'm a dumb or I need to update something in my environment - any thoughts?:

image

Do I need to install webpack globally or something?

I can run webpack out of node_modules, but I'm not sure what it's doing:

image

ChaseWPDEV commented 2 years ago

Silly question: Did you run npm install to load the modules?

twgardner2 commented 2 years ago

Ah, yes, I meant to include that on the screenshot. Everything seemed to install just fine. I'll show you that output when I get home tonight.

On Mon, Nov 29, 2021 at 9:59 AM ChaseWPDEV @.***> wrote:

Silly question: Did you run npm install to load the modules?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/twgardner2/navy_psr/pull/18#issuecomment-981714002, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGJVYJZA7T6BOJCPAOZKFW3UOOIN5ANCNFSM5IL7VHPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

twgardner2 commented 2 years ago

image

twgardner2 commented 2 years ago

I don't understand why npm isn't finding webpack. I can run it manually out of node_modules/.bin/webpack

image

twgardner2 commented 2 years ago

Should it be npx webpack --mode development?

image

ChaseWPDEV commented 2 years ago

Yes that seems to work. Although, it might work without npx altogether e.g. webpack --mode development (not sure if that's from a global I have installed)

twgardner2 commented 2 years ago

yeah, webpack with no npx doesn't work for me. I know that's just a PATH issue and all, I just though node/npm would have taken care of everything...