Nest js disable .hbs files cache - handlebars.js

I am using NestJS(based on Express) with Handlebars template engine.
When I am changing .hbs files and refreshing a page, the NestJS still renders the old versions of templates, until recompilation/relaunch.
I don't know exactly, but I think, NestJS somehow caches .hbs templates.
I tried to add .hbs files as assets in nest-cli.json file, but that didn't solve the problem.
So, how to disable the cache?
Thanks.

Related

Next JS project is breaking after manually adding a folder to the root directory? [duplicate]

The Next.js documentation states, that the directory src/pages is an alternative to /pages. However, my custom _app.tsx and _document.tsx files, get ignored when the pages folder is moved into src.
You can recreate this issue yourself, when creating an empty Next.js App, moving the pages folder into src and updating the import paths of the css files. The content of the index.tsx file will still be rendered, but modifications to the styles/globals.css, which is imported in the _app.tsx will have no effect.
It is impossible to have a pages folder inside of src and outside of src at the same time, therefore preventing me to use src/pages in any app which needs a modificaton to the _app.tsx or _document.tsx.
Am I missing an important part of the documentation or does this work as intended?
Changing your project folder structure or adding new _app/_document files can sometimes lead to caching issues.
Delete the .next folder and restart your dev server, to ensure any caching done by Next.js doesn't get in the way.

Grunt-angular-templates - Don't compile html templates into single JS File

I've created a basic angular project using yeoman's angular generator. While the standard Grunt process is fine in general, I do have my concerns with the way how the views get all minified into the same JS File.
If I have about 10 views on my Page, the requested view can't be seen until 'all' pages have been loaded, since their all in the same file.
I now want to modify the Grunt process, so that each HTMLviewfile get minified into its own file in a views directory. The main angular router should now request the view files as they are requested by the client (user).
Is there any way you could help me. All my research has resulted that the module 'grunt-angular-templates' is responsible for minification of all HTML views. I've yet to find out, how to keep the files from getting merged into a single file.
Thanks!
I found out, that in order to not minify all the view files into the script.js file, you have to remove the ngtemplate process from you gunt build task

Plugin Using Grails

I am using the uploadr plugin for grails 2.4.
Following the documentation I did the following
BuildConfig.groovy
compile "org.grails.plugins:uploadr:1.2.11"
Then in my gsp
<asset:javascript src="uploadr.manifest.js"/>
<asset:stylesheet href="uploadr.manifest.css"/>
Yet it does not display in my gsp.
After some research I realized that my asset piplein folder had only the default application.js and application.css. It did not contain the plugins js or stylesheets?
Is there some way of pointing them towards the assets folder of the plugin?
I then created my own folder in assets called flipcountdown->global_>uploadr and pasted all the files in there but the follwoing still doesnt work.
<asset:javascript src="global/uploadr/uploadr.manifest.js"/>
<asset:stylesheet href="global/uploadr/uploadr.manifest.css"/>
What do I need to do to get this plugin working?
*** This is what I am using for the uplaodr
<uploadr:add name="myUploadrName" path="/my/upload/path" direction="up" maxVisible="8" unsupported="/my/controller/action" rating="true" voting="true" colorPicker="true" maxSize="204800" />
The plugins assets should be pulled in automatically. You don't need to copy them to the project assets. The asset tags resolve to urls such as,
http://localhost:8080/uploadr/assets/uploadr.manifest.css?compile=false
http://localhost:8080/uploadr/assets/uploadr.manifest.js?compile=false
See if you can access the above urls directly.
Furthermore, check your browser dev console and see the network tab for any 404s for any resources. That may give you a clue to any problems with the assets.

Beat way to merge a external web to meteor app

I'm importing a external web template I found in bootstrap to build a intro page. It has it's own js, css , html files.
However I found it is troublesome to transfer the beautiful external web to meteor format by hand. How you deal it smartly?
Now I only can figure out that replacing the html() when the intro is created. (although I still don't know how to do it exactly )
Template.intro.onCreated(function(){
$('html').html('the external code');
});
The simple and dirty way is to put all js, css, and html into public\ directory of your meteor app since this directoy is served "as is"
After that you can start converting your js files (taking into account local and global namespaces) and convert html files into Handlebars templates. Converted files you should move to client folder. Css files you can put in client folder to allow its minification and remove references to css files from Handlebars templates of html pages.
/public folder is usually used for static files like images. I suggest putting everything in a client folder. Usually there will be a lot of redundant js files coming with the template (bootstrap, jquery, fontawesome, etc). Best thing to do is use http://atmospherejs.com/ packages for those libraries and you will most likely be left with the templatename.js file which deals with the html within that template which you'll have to "meteorise"

asp.net static content in separate project. now how to refer?

Project1.csproj is the website project and StaticContent.csproj is the static content project to hold all .css, .js and image files. I am keeping it separate so that designers can work without touching the main project file and may be use cdn in future. But the problem is how do my .ascx and .aspx pages will refer to these css and js files as that when I run in localhost, it still picks up.
I think the best way is you create a website in IIS for the Static project, and reference it trough something like static.myproject.com (having the appropiate setup) on the other one.
You can still use Webdevserver on Project1.
Is most like what you will have when deploy, and you can put the URL on web.config for easy change

Resources