Build System of React-starter-kit - react-starter-kit

I found the same question in stackOverflow unanswered: Different main entry point in package.json for node and browser.
I just want to know how this configuration is done.
How to specify different entries for different build targets in package.json?

It seems that I have the answer.
https://webpack.github.io/docs/configuration.html#target
I can't find any documentation about this, but when you set the Target as 'node', the file required Will be the one from 'main' entry, if you set Target as 'web', the file from 'browser' entry will be required.

Related

Rapidoid custom config file is ignored

I'm very new to Rapidoid and I'm experiencing problem with initial configuration of the application. I'm using Rapidoid 5.5.5 with following Rapidoid modules defined in pom:
rapidoid-commons
rapidoid-http-server
rapidoid-web
Java 11 is used to run the application.
I've prepared a custom config-develop.yml file where I've changed value for port to use from default 8080 to 18888 and added some menu items in gui: section however when I start application none of my changes were used: generated log does not have any data about accepting/use of parameters from my file and configuration files are the files that are included into rapidoid-commons Maven artefact.
Also, the log shows that classpath used is limited to /target/classes folder (I'm using Maven as build tool). So, these are my questions:
What are the rules for merging configuration information when multiple config-*.yml files are present in search path?
How I can tell Rapidoid to ignore some configuration files?
Is it possible to specify explicit name for configuration file as part of initialisation process?
I'm happy to provide additional information if this will help to find an answer to the questions above.
With best regards,
Nick

Can I specify capacitor config file on build?

I want to create two versions of an app with slightly different content. Therefore I thought about having two "www" directories (lets say "www-foo" and "www-bar") and tell capacitor in the capacitor.config.json which one to use (with "webDir" setting). Also the "appId" should be different then.
So I guessed the easiest way would be to have these capacitor.config.json files with different "appId" and "webDir" settings and when running the build script to specify which config file to use (like it's known from webpack with --config flag). But I can't find any information if it's possible to specify the config file to use for building the app.
Is it just not possible (yet) or am I too stupid to find it? :)
Otherwise I would try to create the capacitor.config.json file with webpack before running the capacitor build script.
I used this article as a guide for my project.
I don't know if exist any option for two or more AppID/webDir in Capacitor.
But understanding you necessity my suggest is create a custom build script in Node.js that change info in capacitor.config.ts (appId) > build (www/www-Two) > sync & copy to platform

Multiple entry points with Snowpack

I'm looking to switch from Webpack to Snowpack for a development environment. But I have multiple entry points set up in Webpack and I haven't been able to find an example of how to do this in Snowpack. It seems that Snowpack is meant to be used with a true SPA that has only one HTML page and one entry point Javascript file.
Each HTML page on the site (20 altogether) has its own index.js that is the starting point for that page and is independent from the other pages on the site. How would this work in Snowpack?
I found some discussions on Github about multiple entry points, but reading through the comments I wasn't able to determine if this is supported or not. If it isn't supported, would I need to run Snowpack for each index.js? Or is there another fast development tool that would work in this use case?
If you check the config documentation, you will see the mount option is an object, meaning you mount multiple directories. If you have multiple top level modules in a mounted directory, you will get multiple entry points.
For example, following configuration takes any module from src folder and outputs it to dist folder in your build directory:
mount: {
src: { url: '/dist' },
},
Say you have src/index.tsx and src/module.tsx files, you will get dist/index.js and dist/module.js files in your output directory.
I just tested and it works.

CMake search path configuration

we working on a C++/CMake project, that needs to run in both Windows and Linux. On Windows, we have to work with a number Visual Studio versions, both in 32- and 64 bit. In order to alleviate dependency issues in our team, we have manually compiled a number of dependencies for each configuration(vs2013_x64, vs2013_x86, vs2012_x64, vs2013_x86...) and installed them (using make install or similar commands) to a common folder for each configuration. Now we have a folder called "vs2013_x64" for example, that contains similar folders as /usr would on linux: CMake, include, lib, share, ...
Now my question is: How do I have to set up CMake, so that it treats this vs2013_x64 folder just like it does /usr on Linux?
I found a number of variables that seem related, for example
CMAKE_FIND_ROOT_PATH and CMAKE_SYSROOT. However, setting them to my vs2013_x64 folder for example does not work: FindXXX.cmake files in the vs2013_x64/CMake folder are not found, and even when I manually set the CMAKE_MODULE_PATH to that CMake folder, the Find* scripts are unable to find the include they are looking for, because the vs2013_x64/include folder does not appear to be searched.
A solution that did work was to set the CMAKE_PREFIX_PATH. This is nice and almost what I need, but lets say that on Linux, I would not want it to look at /usr at all under any circumstances. This would not be possible using the PREFIX_PATH solution if I understand it correctly.
From what I understood from the documentation,
CMAKE_FIND_ROOT_PATH is more configurable and has a number of additional variables such as CMAKE_FIND_ROOT_PATH_MODE_PROGRAM, CMAKE_FIND_ROOT_PATH_MODE_LIBRARY and CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This makes me believe that FIND_ROOT_PATH is what I actually SHOULD be doing - yet I am unable to make it work
Does what I am trying to do make sense? Can anyone clarify when and how to use what? Ideally, I would like a solution that allows me to set the search path to my vs2013_x64 folder on Windows, that defaults to /usr on Linux, but can optionally also be set to another directory containing lib/include/cmake folders. In addition, it would be nice if searching ONLY occurred in the configured path and nowhere else (to avoid mistakenly picking a library that was installed system-wide).
Thanks!

Unable to specify .nsolid-proxyrc for Nsolid Proxy is causing issues

We have a situation where we want to be able to start the Nsolid Proxy/Hub from an arbitrary folder. When we try to do this it fails due to not being able to find .nsolid-proxyrc in one of the parent folders.
We took a look at the source code for Nsolid Proxy and it looks like the library it is using, rc, allows end-users to specify a file location, but Nsolid Proxy doesn't accept a CLI argument that allows us to specify it. It should be functionality that is easy to add, but it appears to be a closed source project.
TL:DR; We need to be able to specify the exact location of .nsolid-proxyrc when starting the hub. Is there a known work-around for this or is there a way we could request this feature gets added to the project?
You can specify the configuration file by using the --config flag (from rc) when starting N|Solid Proxy
$ nsolid proxy.js --config /path/to/config/file
By default it will look at the current working directory and then up the folder tree like node_modules then resort to the following locations:
$HOME/.nsolid-proxyrc
$HOME/.nsolid-proxy/config
$HOME/.config/.nsolid-proxy
$HOME/.config/.nsolid-proxy/config
/etc/nsolid-proxyrc
/etc/nsolid-proxy/config