Skip to content

Commit

Permalink
fix ignore path problem (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
hl662 committed Aug 8, 2023
1 parent be8cc69 commit a9b7a23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
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

0 comments on commit a9b7a23

Please sign in to comment.