Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ignore path problem #106

Merged
merged 3 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions packages/react-scripts/README-imodeljs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ Current upstream is `react-scripts@5.0.1`, a diff of upstream and this fork can

> Note: These configuration variables are an extension of the [Advanced Configurations](https://create-react-app.dev/docs/advanced-configuration) supported by create-react-app.

| Variable | Development | Production | Usage |
| ----------------------- | ----------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| USE_FAST_SASS | ✅ Used | ✅ Used | When set to `true`, use the `fast-sass-loader` instead of `sass-loader`. This helps with long build times on smaller machines attempting to build an app with a large amount of scss/sass files. |
| USE_FULL_SOURCEMAP | ✅ Used | 🚫 Ignored | When set to `true`, the sourcemaps generated use `source-map` instead of `cheap-module-source-map`. This is known to cause out-of-memory errors but gives full fidelity source maps in debug builds. |
| TRANSPILE_DEPS | ✅ Used | ✅ Used | When set to `false`, webpack will not run babel on anything in node_modules. Transpiling dependencies can be costly, and is often not necessary when targeting newer browsers. |
| DISABLE_TERSER | 🚫 Ignored | ✅ Used | When set to `true`, skips all minification. Useful for PR builds and test apps. |
| DISABLE_COPY_ASSETS | ✅ Used | ✅ Used | When set to `true`, skips applying the copy plugin to extract assets from @bentley or @itwinjs packages. |
| USING_NPM | ✅ Used | ✅ Used | When set to `true`, indicates that the application uses npm instead of pnpm. This disables a pnpm workaround while copying assets. (The pnpm workaround prevents assets copying from working in npm.) Ignored if `DISABLE_COPY_ASSETS` is `true`. |
| Variable | Development | Production | Usage |
| ------------------- | ----------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| USE_FAST_SASS | ✅ Used | ✅ Used | When set to `true`, use the `fast-sass-loader` instead of `sass-loader`. This helps with long build times on smaller machines attempting to build an app with a large amount of scss/sass files. |
| USE_FULL_SOURCEMAP | ✅ Used | 🚫 Ignored | When set to `true`, the sourcemaps generated use `source-map` instead of `cheap-module-source-map`. This is known to cause out-of-memory errors but gives full fidelity source maps in debug builds. |
| TRANSPILE_DEPS | ✅ Used | ✅ Used | When set to `false`, webpack will not run babel on anything in node_modules. Transpiling dependencies can be costly, and is often not necessary when targeting newer browsers. |
| DISABLE_TERSER | 🚫 Ignored | ✅ Used | When set to `true`, skips all minification. Useful for PR builds and test apps. |
| DISABLE_COPY_ASSETS | ✅ Used | ✅ Used | When set to `true`, skips applying the copy plugin to extract assets from @bentley or @itwinjs packages. |

- Typing changes

Expand Down
6 changes: 2 additions & 4 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ const shouldMinify = process.env.DISABLE_TERSER !== 'true';

const shouldCopyAssets = process.env.DISABLE_COPY_ASSETS !== 'true';

const isUsingNpm = process.env.USING_NPM === 'true';

// End iModel.js Changes block

// Source maps are resource heavy and can cause out of memory issue for large source files.
Expand Down Expand Up @@ -159,8 +157,8 @@ module.exports = function (webpackEnv) {
from: "**/public/**",
noErrorOnMissing: true,
context: path.dirname(require.resolve(`${paths.appNodeModules}/${dependency}/package.json`)),
globOptions: isUsingNpm ? undefined : {
ignore: ["**/node_modules/**"],
globOptions: {
ignore: ["/node_modules/**", "**/index.html"],
},
to({ absoluteFilename }) {
const regex = new RegExp("(public(?:\\\\|\/))(.*)");
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bentley/react-scripts",
"version": "5.0.4",
"version": "5.0.5",
"description": "iTwin.js configuration and scripts for Create React App.",
"repository": {
"type": "git",
Expand Down