How to include a folder with resources in the build - next.js

I need some config text files to be included in the build, they are used at the server side and will be opened with readFileSync, these files are not loaded via import and don't have .js or .json extension so when doing a build they don't get included in the release, ¿ it's necessary to make a custom webpack config for this ?
These files should not be available from the internet, so i can't put them in the public folder.
i.e: in java normally you have a folder called src/main/resources folder for this.

You can create a custom resources (or any name, tbh) directory, put your files in there and use them from there on production. Building process in next.js is different than java, next.js will transpile your app into the .next directory and all your existing files will be available, too.

Related

Javafx project deployment - how to handle assets/resources?

I recently finished my first JavaFX project and am ready for deployment. I found that when I create the jar file for my project my ide creates a folder with the jar and other necessary files. I noticed that when I run the jar in the file everything works fine. However, when I take the jar our of that folder and place it as a desktop icon, various resources no longer become available - I am assuming this is because the jar file and the various resource files are no longer in the same file path/folder. - Is this the correct assumption to make?
Regardless, I wanted to ask what is the standard method of getting JavaFX resources and the accompanying jar file to work when the resources are not located in the same folder?
Essentially, I want to have a clickable desktop icon that launches the app, which the jar file fulfills. But if I put that jar file in a folder with its resources to get the project to work properly then the user will have to press the folder and then the jar file in order to get the project to launch - which is very counterintuitive.
Any ideas on how this issue is handled?
The best way to do this is to create a shortcut to your jar file not copy it to another location. The jar file depends on these resources to execute especially if you used external libraries.
The other alternative would be to export your jar file with the libraries included in the jar. This however would make your jar very huge depending on the number of libraries you have.
I hope this helps.

How to get CSS from SCSS file in angular to upload in to a server

Here is my need:
I have created a angular library which is used by number of applications. the library has the all styles file as ".scss" extension. in case of any update in library each application require to build the angular-library, instead I decided to keep the library scss/css files in server. so it will automatically updated with all apps.
as a try i uploaded the '.scss' file, but it's not working after i added the file in index.html
the question is:
how to include the style.scss file in other applications - if not possible then
hot to convert scss files in to css file while i do library build and same can uploaded in server
please help me.
at the root of project in angular.json u can add styles files from libraries (like global syle.scss) and angular application will convert them automatically

ASP.NET 5 MVC6 Custom CSS & Javascript placing convention

So I'm playing around with MVC6, and I've added bower.json & grunt.json, I've created my grunt tasks for generating my jQuery & bootstrap.css and its all sitting in the wwwroot folder as i expected.
But what about things like my site.css & my main.js files, the files that I will add to for the project over time.
What convention are people using when choosing a directory for this stuff?
Are we to add a Content folder and drop it in?
Is there something I'm missing, that i should also be using Grunt / bower for?
I do have app and vendor folders outside wwwroot.
In vendor, I customize libraries like bootstrap, themes.
In app I have my own css, less and js files for the application.
I also have an asset path inside app for anything that needs to be copied (folder font shown in the screenshot)
Then I use the opinionated really easy to use and way better than grunt or gulp tool: brunch.
With this simple config, I get sourcemaps, concat, jshint, and with --production also uglify, minify, csso.
Adding anything else to the pipeline is simple as installing a brunch-plugin, so I recommend to also check http://brunch.io/ out.
Any static files (.css, .js) should be added directly into the wwwroot path (e.g. wwwroot/scripts, wwwroot/css). Anything that will be compiled into static files (.ts, .less) should be put into an Assets directory (or whatever name you like) in your project and output into the wwwroot path during compilation (generally configured through grunt compilation tasks).

Qt can't access some .dll files

I am working on a plugin for some application, and I am using libtiff. The filter is working just fine, but there is a problem. There are some .dll files that have to be included in compile path. When I add those .dlls in \QtSDK\Desktop\Qt\4.8.1\mingw\bin the plugin is working fine, but when i delete one or more of those .dlls, plugin is not recognised by the application. Those .dll are not included in the Qt SDK by default.
Is there any way I can include those .dll in my plugin and add a path to them without copying them to the Qt SDK bin folder.
Usually I add my plugins to my application directory and add this line of code to main() in main.cpp like so:
qApp->addLibraryPath(QString("."));
Image plugins go in imageformats and SQL drivers (ODBC) go in sqldrivers. You can make the library path anything you want relative to your application root directory. I like to keep things simple and just reference the root directory.

Qt including resource directory structure inside executable

I'm using QWebView to run a web app. There are 650+ files. Placing the web app's directory in the source directory does not result in the executable bundling the directory.
How do I include the entire web app directory so that the executable will be able to render the files.
Note: I have currently added index.html as a resource, and can access it with qrc:// - But since I cannot add the entire directory structure to a qrc (can I?), the executable does not include the other files.
You need to put an XML node into the .qrc file for each file you want to use using the Qt resource system.
This can be done using a simple pre-build script. Take a look at qrcgen. Quoting the blog post behind this link:
The script I created, qrcgen, takes a directory and a prefix, recursively scans the directory and generates a .qrc file with the same name as the directory scanned. It has solved my problem, and I hope it can help others. It is also available via PyPI, just "easy_install qrcgen".
In order to update the .qrc file whenever your directory contens change, you need to include this step into your build process:
For C++/Qt projects, you can add this step in the build configuration in QtCreator or add in your qmake file a system(...) statement. Note that such commands aren't portable in general. (If it's not portable, you can put some operating system conditions around multiple commands.)
For PyQt/PySide projects, I don't know how to do this, but I'm sure you find a solution for this too.

Resources