The solid-file-client 0.5.0 and 0.5.1 do not build in react-solid due to “null” module not found (the pb do not occur in node and can be solved differently with browserify using the ignore param.
There is a work around building solid-file-client using webpack null-loader.
The problem I uncountered is to test the new solid-file-client.bundle.js in react-solid.
I tested :
require(’./solid-file-client.bundle.js’) and it never succeed compiling with a lot of messages like : Line 1: Expected an assignment or function call and instead saw an expression no-unused-expressions
finally I decided to test a npm like way --> putting the new solid-file-client.bundle.js in node_modules/solid-file-client/dist/browser/ and use require('solid-file-client').
The compile succeeded so the package loads successfully in react-solid.
Is it the good way in react-solid to test a package before pushing it to npm ?
Isn’t there a cleaner way to do that ? It seems very tricky.
I would like to know the answer to this question and how the webpack external set to null setting impacts downstream requires. But I also wonder, if it wouldn’t make more sense to simply include solid-file-client in a script tag. It exports a SolidFileClient constant that can be used in any scripts loaded after it is loaded. So two script tags: one for the solid-file-client bundle and one for the react bundle. Here’s an example that works out of the box with solid-file-client 0.5.1.
used the solid-file-client fork to build a new version with npm install
To use the cra-solid-file-client example, I :
copy solid-file-client.bundle.js to /src/
used require(./solid-file-client.bundle.js) in solid.js. I made npm install then npm start. Compile did not succeed
then copy the new solid-file-client.bundle.js to /node_modules/solid-file-client/dist/browser/ and changed back to require('solid-file-client') in solid.js. Then just npm start and compile succeeded.