I started a web app using Laravel 6 years ago and trying to optimize it and update the technologies around it. I was searching for minifying my .css and .js files (or any minifyable files) without using NPM since I do not have NPM installed in my project and that it is not a Node project.
What are my options?
Can I integrate NPM in my project?
Is there another way to minify without using NPM?
If I integrate NPM in my project, since I did not create my project with NPM, is it easy to do it?
Thanks for helping me out :)
Related
Is it possible to build a website purely made from HTML/CSS/JS with npm?
I want to use some npm modules in my 1 javascript file, but I don't know which built tool I need to use and how in order to end with just 1 JS file.
Thanks for the help!
I have an existing application in Angular 1.6.
We are currently using grunt and bower to build the application. Now the requirement came to migrate the existing application to webpack and removing grunt and bower. Anyone can give me the right suggestion, how to approach for the same. I am struggling with entry point, bundle path and the loader I am supposed to put in webpack config. The index.html, which script tags to remove and how to include the bundle file. Any guidance would be appreciated.
I am not a web developer, and though I believe this question must have a simple answer, I couldn't find it in the documentation, nor online.
I'll use html5 boilerplate to create a very simple app.
I would like to run
npm install an-arbitrary-js-library --save
gulp build
and be able to
import a_random_function from 'an-arbitrary-js-library'
in my js/main.js file.
How can I adapt my HTML5 Boilerplate to add third-party JS libraries to my project automatically?
Just put a script tag with the source referring to your library in the index.html file.
I don't know how you orginzed the project but you can copy the file of your third library from node_module to the project js/vendor or any other folders using gulp see from line 69 --> 95 here, this is the way they set jQuery in the project.
I've searched all over google and checked out the official docs for Webpack but have not had any luck finding a tutorial/guide/plugin to even do this. Has anyone done this before or should I just drop webpack altogether and go for a grunt-maven-war file generator instead?
Well, there is nothing special in building spring-boot with webpack. You can install node globally, you can install it during build...
You just add plugin to pom.xml to run node command i.e. (https://github.com/eirslett/frontend-maven-plugin)
And that actually it. It runs webpack and you get your js, css, fonts, ... files in some folder. Now you proceed like it is usual static assets, pack them into war and enjoy.
When I install e.g. jQuery from Nuget into my VS C# project, jquery.js ends up in my packages folder. This is good, since I don't want to check this file into my source control, since it's not my code and I'm never going to change it - in this context it's the equivalent of a DLL I might get via a different package. So far, so good...
Why, then, does the package installer also copy the file into the project Scripts folder, when surely it would be better to add it to the project as a link to the file in the packages folder, much as a Nuget package DLL would be referenced by the project.
The team have decided to drop support for content files in nuget packages. And they are recommending to use other package managers for client side libraries like npm, bower etc. There is a built in support for them in studio 2015.
One of the reasons is that every time some client package was updated on npm repo one of the guys in microsoft team had to fetch it repackage into nuget and publish.
Check it out!