diff --git a/packages/react-scripts/README-imodeljs.md b/packages/react-scripts/README-imodeljs.md index 5f7d703179e..d72ab0f91e1 100644 --- a/packages/react-scripts/README-imodeljs.md +++ b/packages/react-scripts/README-imodeljs.md @@ -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 diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 80a5f7a2b29..41415554ce8 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -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. @@ -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(?:\\\\|\/))(.*)"); diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 6b1aa7ae016..6e90b05eb11 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -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",