this is a simple question, but I have been puzzling over it for a while now and it doesn't have much documentation to look at:
I've got a development setup with ClojureScript, figwheel, npm deps working just fine for me. But when I produce a production, compiled JS file, it does not find the npm dependency files. So where and how do I place which of these packages in the production web server, so that they will be found and loaded?
Regards,
Chris
All files required to run your JS will be included in the compilation output after :advanced optimizations. No node_modules files will be required at all so there should not be any need to place them anywhere. Only the files produced by the build directly should be loaded.
:npm-deps however is an alpha feature with many known issues. You can use alternate solutions like webpack or shadow-cljs which work much more reliable.
Related
I'm trying to start a new project in the Nuxt JS framework with
npx create-nuxt-app project-name
After completing the installation I realized some of the directories are missing.
Missing directories are - layouts, middleware, plugins, and assets.
At first, I thought I did something wrong then I tried second and third times and the result is the same.
I searched their official documentation and GitHub issue about this problem but I didn't found anything.
npm : "6.14.12"
nuxt: "^2.15.3"
The latest version of Nuxt is more simple and do have less boilerplate, it follows a simpler tutorial design (to probably lose less users on the road).
You can still add those yourself and it'll work perfectly fine!
This is probably because of Nuxt3 approach and the will to make teach things in a more minimalistic way.
More info here: https://github.com/nuxt/create-nuxt-app/releases
An official answer from Atinux can also be found here: https://github.com/nuxt/create-nuxt-app/issues/821#issuecomment-877653294
Also, everything is still explained in the README.md, with various links to the official documentation.
You can fix non working layouts directory like so:
update your package.json file with "nuxt": "^2.15.8"
See also: https://nuxtjs.org/docs/release-notes
and run npm install
and your layouts folder will work again.
had the same problem.
the project nuxt version was 2.15.7. actually the layout page property does not recognize layouts directory and updating nuxt version to 2.15.8 solved it.
I'm a noob and have read a couple articles about build tools but want to verify what I know:
Build tools minify and concatenate your front end code into a package of executable files that you can then put on a development server so that it can be served to your backend server (liker rails) to show stuff? Not sure if that's correct, but any help in the most layman terms would be greatly appreciated!
NPM is the node package manager where from you can install libraries and such.
Yes you can put your front-end .js files together and minify them with grunt to a build directory at the server. You can also turn for example less into css or typescript into js depending on how you configurate your Grunt.
Take a look at their documentation and there is also a quite excellent tutorial there also https://scotch.io/tutorials/a-simple-guide-to-getting-started-with-grunt
I am new to the development based on java-script frameworks. I want to understand gulp, npm. Somewhere, I read that these are open source client side development tool but I could not get more insight on this. Please help!
It is a task runner, written in JavaScript to be run in a nodeJs environment. You need a package manager like npm to install it. Npm comes with nodejs.
An Introduction to Gulp.js
It is an application doing things like the following, instead of you. You need only to code once the instructions and run it.
Compressing new and modified images; compiling Sass to CSS code; code linting and validation; concatenating and minifying CSS and JavaScript files; deploying files to development, staging and production servers.
I use npm scripts a lot for my javascript/node projects (npm start, npm test, and npm run build and others), and I was wondering if there is something similar for elm-packages, or if we should use npm scripts instead, and if I have to do it, why do we need a package.json and a elm-package.json?
The quick answer is that (as of May 2017) there's not support for this in elm-package.json.
As for the future: Evan Czaplicki has said on elm-dev mailing list that the file format and functionality will get revamped a little bit (probably with the 0.19 release), but most probably mainly with regards to application vs. library distinction. Based on that, I don't think elm-package.json will get this functionality anytime soon.
I think most devs have some node stuff running to handle their dev environment (e.g. webpack stuff) so you will always have package.json available for such scripts anyway.
There is a question about whether elm should embed its dependencies within package.json but, while most dev instances would have package.json, anyone just trying out with elm-reactor would not. So I think the present situation is here to stay, and enables you to do what you want.
Lately I have been wondering if there is any way to use bower or npm only as a consumer.
Let’s say I am not really interested on developing the package further, but simply using it on my website/application.
So as I would first think:
npm install jquery
I have tried with the flag --production but the same structure was downloaded.
However, that brings me a huge tree of files and the only one I would need is the jquery/dist/jquery.min.js file.
Same goes for bower:
bower install jquery
Again, an expensive list of files, including src folder with a lot of dev-only related files.
I am sorry if I am wrongly assuming package managers behaviour here, but it would be interesting to know how to use these package managers as a simple end-user instead a developer in order to keep my project dependencies updated.
At the moment, I feel that it's just too much for what I need, and that by simply copying jquery.min.js over to my project src folder, it would be much cleaner/simpler.
If the concept of both npm and bower is different and someone can point it out it would be appreciated as well as any tips for an alternative package manager that only imports essential production files.
Apparently Volo does exactly what I was looking for following a concept where JS libraries should be kept as one single JS file.
Here, more information about the project’s design goals.