@reactunity/scripts 0.16.4 → 0.16.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,6 +28,7 @@ Environment variables of CRA can be used with React Unity. However, there are so
28
28
  - `FAST_REFRESH` - This can be set to `false` to disable `react-refresh` if you are having problems with hot reload
29
29
  - `IMAGE_INLINE_SIZE_LIMIT` - `0` by default. Because non-inlined images will be faster in Unity. However, if users still want to inline images, they should increase this limit.
30
30
  - `JSX_IMPORT_SOURCE` - Can be used to allow some custom JSX transformations. For example, set this variable to `@emotion/react` for Emotion.
31
+ - `ENABLE_SCOPE` - Can be used to restricts imports to `src` folder only.
31
32
 
32
33
  Environment variables can also be defined by having `.env`, `.env.local`, `.env.<development|production>` in project folder.
33
34
 
@@ -57,6 +57,7 @@ const emitErrorsAsWarnings = process.env.ESLINT_NO_DEV_ERRORS === 'true';
57
57
  const disableESLintPlugin = process.env.DISABLE_ESLINT_PLUGIN === 'true';
58
58
  const extractCss = process.env.EXTRACT_CSS === 'true';
59
59
  const generateManifest = process.env.GENERATE_MANIFEST !== 'false';
60
+ const enableScope = process.env.ENABLE_SCOPE === 'true';
60
61
 
61
62
  const imageInlineSizeLimit = parseInt(
62
63
  process.env.IMAGE_INLINE_SIZE_LIMIT || '0'
@@ -333,7 +334,7 @@ const baseConfigFactory = function (webpackEnv) {
333
334
  // To fix this, we prevent you from importing files out of src/ -- if you'd like to,
334
335
  // please link the files into your node_modules/ and let module-resolution kick in.
335
336
  // Make sure your source files are compiled, as they will not be processed in any way.
336
- new ModuleScopePlugin(paths.appSrc, [
337
+ enableScope && new ModuleScopePlugin(paths.appSrc, [
337
338
  paths.appPackageJson,
338
339
  reactRefreshRuntimeEntry,
339
340
  reactRefreshWebpackPluginRuntimeEntry,
@@ -341,7 +342,7 @@ const baseConfigFactory = function (webpackEnv) {
341
342
  babelRuntimeEntryHelpers,
342
343
  babelRuntimeRegenerator,
343
344
  ]),
344
- ],
345
+ ].filter(Boolean),
345
346
  },
346
347
  module: {
347
348
  strictExportPresence: true,
@@ -400,7 +401,7 @@ const baseConfigFactory = function (webpackEnv) {
400
401
  // The preset includes JSX, Flow, TypeScript, and some ESnext features.
401
402
  {
402
403
  test: /\.(js|mjs|jsx|ts|tsx)$/,
403
- include: paths.appSrc,
404
+ include: paths.appPath,
404
405
  loader: require.resolve('babel-loader'),
405
406
  options: {
406
407
  customize: require.resolve(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactunity/scripts",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "description": "Configuration and scripts for React Unity.",
5
5
  "repository": {
6
6
  "type": "git",