31 Commits

Author SHA1 Message Date
Jack Hsu
724b0c0e3c
feat(core): upgrade to webpack 5 (#7283)
* feat(core): upgrade to webpack 5

* chore(core): update webpack 5 docs
2021-10-13 00:34:28 -04:00
Jack Hsu
a8bcd27933
fix(react): apply postcss config from apps to their lib dependencies (#7265)
Fixes #7040
2021-10-08 14:10:25 -04:00
Juri Strumpflohner
20d4ae2ed9
fix(storybook): add Emotion v11 support to current Nx React Storybook setup (#6787) 2021-08-20 08:54:56 -04:00
kazamov
05faf8830b
fix(storybook): add check if plugins exist or fallback to empty array (#6714)
As storybookWebpackConfig.resolve.plugins may be undefined add a fallback to empty array.

Co-authored-by: Zakir Nuriiev <zakir.nuriev@caspio.com>
2021-08-13 13:29:32 -04:00
Juri
b5b5f250d0 feat(react): add Nx React Storybook preset 2021-08-06 18:11:47 +02:00
Jack Hsu
70c0921180
feat(react): add fast refresh support for webpack 5 (#6529) 2021-07-29 18:16:26 +00:00
Miroslav Jonaš
8ab463e386
cleanup(core): replace deprecated usage of appRootPath (#6241)
* cleanup(core): replace deprecated usage of appRootPath

* cleanup(core): revert migration changes
2021-07-05 15:51:19 -04:00
Jack Hsu
369da3ee78
feat(web): add support for webpack 5 (#5892) 2021-06-29 08:41:01 -04:00
Emily Xiong
b8584a6f18
feat(react): add react fast refresh to webpack (#5612) 2021-05-18 15:47:18 -04:00
Jack Hsu
c84bbb3c93
feat(react): add support for new jsx transform (#5131) 2021-04-01 13:46:12 +00:00
Jesse M. Holmes
852d7391fb
fix(react): merge options.output.globals with extraGlobals (#4571)
ISSUES CLOSED: #3789
2021-01-25 13:41:00 -05:00
William Ghelfi
742ea79d53
Fix svgr/webpack conf (#4327)
* fix(misc): avoid issues with refs in SVGs

The previous "import friendly" syntax was actually disabling refs in SVGs parsed by svgr.

I found 3 possible solutions:
1. Removing "![path]"
2. Separating "+ref![path]" with another comma: "+ref,![path]"
3. Rewriting the loader entry in the style of the other loader entries

I chose the last one for added clarity within the file.

* fix(core): fix compilation errors
2021-01-15 09:09:55 -05:00
Adam L Barrett
889b648886
Emotion upgrade for React and Next plugins (#4088)
* chore(react): update emotion to new versions and new package names on react plugin

* chore(nextjs): update emotion to latest version and the new package names

* feat(misc): have react and next plugin migrations update emotion imports

 * add renamePackageImports and renameNpmPackage rules to workspace utils
 * update migrations to update emotion imports to the new name and version
2020-11-27 13:32:42 -06:00
victor savkin
234ca36385 cleanup(misc): clean up devkit 2020-11-26 10:19:13 -05:00
Spencer Elliott
5b6df632cb
fix(core): resolve webpack loaders with require.resolve() (#3436)
* fix(core): resolve webpack loaders with `require.resolve()`

With strict package managers such as pnpm or Yarn PnP, transitive
dependencies are *not* hoisted to the root node_modules folder. This
means that a webpack config defined within a package like
'@nrwl/cypress' cannot resolve loaders like 'ts-loader', unless
'ts-loader' is declared in the workspace's own package.json.

This is a problem because the workspace might define a different version
of 'ts-loader', incompatible with the version declared by
'@nrwl/cypress/package.json'. The workspace should not need to declare
a dependency on 'ts-loader' anyway.

See also:
* https://github.com/pnpm/pnpm/issues/801
* https://github.com/webpack/webpack/issues/5087

* fix(core): resolve absolute 'raw-loader' path

When replacing the 'raw-loader' rule in the `getStylesPartial` function,
check for the absolute path of 'raw-loader' rather than just the name.
2020-08-08 17:53:00 -04:00
Jack Hsu
ed8bd2bbe8
Revert "fix(core): resolve webpack loaders with require.resolve() (#3341)" (#3371)
This reverts commit d74ab4e9d6eae6d83c3bb76072b45f7a4c7a6305.
2020-07-20 16:24:47 -04:00
Jack Hsu
83865747e9
fix(react): move url-loader to the react package.json (#3356) 2020-07-17 10:41:16 -04:00
Spencer Elliott
d74ab4e9d6
fix(core): resolve webpack loaders with require.resolve() (#3341)
With strict package managers such as pnpm or Yarn PnP, transitive
dependencies are *not* hoisted to the root node_modules folder. This
means that a webpack config defined within a package like
'@nrwl/cypress' cannot resolve loaders like 'ts-loader', unless
'ts-loader' is declared in the workspace's own package.json.

This is a problem because the workspace might define a different version
of 'ts-loader', incompatible with the version declared by
'@nrwl/cypress/package.json'. The workspace should not need to declare
a dependency on 'ts-loader' anyway.

See also:
* https://github.com/pnpm/pnpm/issues/801
* https://github.com/webpack/webpack/issues/5087
2020-07-15 13:55:38 -04:00
Jack Hsu
d593153a33
feat(react): refactored babel support so options are more easily customized (#3089)
This reverts commit 7679df22f5b90d085b5f32f2135d828036ee5aa7.
2020-05-29 02:09:47 -04:00
Victor Savkin
7679df22f5 Revert "feat(react): refactored babel support so options are more easily customized (#3058)"
This reverts commit 0e036272cbe156fe9750a2f2bc6498a08cf7f457.
2020-05-28 13:11:56 -04:00
Jack Hsu
0e036272cb
feat(react): refactored babel support so options are more easily customized (#3058) 2020-05-26 09:16:36 -04:00
Jason Jean
e06822da7e
chore(repo): update prettier to v2 (#2934)
this is just for the repo, and not the workspace

Co-authored-by: Rares Matei <matei.rar@gmail.com>
2020-04-29 01:09:37 -04:00
Jack Hsu
122af4fff3 fix(react): fix rollup options extension to be compatible with output arrays 2020-03-04 14:27:17 -05:00
Jack Hsu
a433035eca
chore(react): update web/react dependencies and clean up npm warnings (#2547) 2020-02-25 11:03:58 -05:00
Jack Hsu
20885513ae
fix(react): add fallback for SVG imports coming from non-TS/JS modules (#2351) 2020-01-21 10:06:30 -05:00
Jack Hsu
df7ff8cbae
feat(react): add better support for file and image imports (#2245) 2019-12-30 13:36:44 -05:00
Jack Hsu
ef995fdabe feat(react): add SVG and SVGR support for React apps 2019-12-28 11:06:45 -05:00
Jack Hsu
a524b2e947 feat(react): add publishable library support
Issue #1521
2019-10-02 16:26:20 -04:00
Jack Hsu
3cc01b9155
fix(react): add react preset right after env (#1817) 2019-09-10 07:05:18 -04:00
Jack Hsu
811c50b92c feat(web): use babel-loader instead of ts-loader for web build builder
- removes the `differentialLoading` build option
- differential loading is always enabled for prod builds

BEFORE (without ESM):

Benchmark #1: nx build demo --prod
  Time (mean ± σ):     13.834 s ±  1.731 s    [User: 11.817 s, System: 1.352 s]
  Range (min … max):   11.947 s … 16.015 s    10 runs

AFTER (with ESM):

Benchmark #1: nx build demo --prod
  Time (mean ± σ):     18.711 s ±  1.310 s    [User: 12.172 s, System: 1.394 s]
  Range (min … max):   17.232 s … 20.770 s    10 runs
2019-09-05 15:34:01 -04:00
Jack Hsu
776a185d65
feat(react): adds default babel-loader support for react apps (#1631) 2019-07-25 15:33:26 -04:00