build(build-scripts):build improvements for improved compatibility #295 #296
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unable to run repo on a Windows or other OS.
295 issue link
Use Case for Proposal
I recently ran into an issue i wanted to take time to debug because i really wanted to use jodit in my Next.js project and i wanted to check if the demo could reproduce the same issue outside of Next or if it would be easier to debug with the repo locally - so this is why this is a problem if the repo cannot be run in different environments. These fixes allowed me to run and find the issue and open PR for it as well as these build fixes.
Opening this issue to link to PR.
The PR fixes 3 issues listed below with descriptions of the type of errors they throw in another environment i.e. Windows:
npm run build
npm run build:types
npm run remove-css
These issues prevent the contributor or user from running build scripts on different OS environments.
Details of issues when trying to run those 3 scripts below:
NODE_ENV
instead ofcross-env NODE_ENV
is OS incompatible. cross-env makes it OS compatible which is good for a project that benefits from many contributorsnpm run build:types
brokenThrew an error due to issue with
remove-css
- this is a simple fix in package.jsonAlso could not build due to
"skipLibCheck": true
missing in tsconfig.types.json - threw errors about every .d.ts file, recommended to set to true so will be able to run buildnpm run build
broken (below)This is what happens when using this
./node_modules/.bin/webpack
in Windows env (below)Fixed by updating webpack.config to .js and package.json (adding webpack script that allows webpack to run correctly in any environment)
This allows
npm run build:types
andnpm run build
runs successfully.Fixes #295