Commit Graph

645 Commits

Author SHA1 Message Date
Anna Henningsen
7b7acde872 Update webpack-dev-server 3.1.5 → 3.1.7 (#4955)
This fixes the functionality of this dependency for Node 10 and above.

Refs: https://github.com/webpack/webpack-dev-server/pull/1451
Refs: https://github.com/nodejs/node/issues/21665
2018-09-02 21:02:29 +01:00
Dan Abramov
96ba7bddc1 Bump versions 2018-08-22 19:44:29 +01:00
Jed Fox
69c3d4b04c Update support info for service workers (#4825) 2018-07-26 13:50:29 -04:00
Jack Zhao
52449c34ee Only use safe options when packing CSS assets (#4706)
* support scoped packages for cra --scripts-version option

* enable safe option to cssnano processor

Fixes #4682
2018-07-23 01:22:05 -04:00
Vladimir Kutepov
8169a93e38 Bump babel-loader to fix npm warning (#4776) 2018-07-23 01:15:41 -04:00
Jack Zhao
366e5d3475 [internal] Separate out kitchensink test into two (#4767)
* support scoped packages for cra --scripts-version option

* seperate out kitchensink test

* add eject to node 6 testing

* travis node 6 eject

* fix CI warnings
2018-07-15 12:21:32 -06:00
Mike Wilcox
706b319633 Fix typo (#4738) 2018-07-05 12:46:24 -04:00
Miguel Palau
4a87838f52 remove extra dot on devtool link comment (#4741) 2018-07-05 12:40:55 -04:00
Ideveloper
26f701fd60 Suggest reactstrap instead of react-bootstrap (#4703)
* Suggest `reactstrap` instead of `react-bootstrap`

* Update README.md
2018-06-29 21:24:38 -04:00
Dmitriy Sadkovoy
3e165448a7 Added thread-loader config for application code entrypoint (#4582) 2018-06-07 01:06:47 -06:00
Dmitriy Sadkovoy
d0afe4b3b9 Configured the thread-loader to keeping workers alive in development mode (#4562) 2018-06-05 18:27:34 +02:00
Marius Gedminas
fffe909731 Move whitespace comment closer to where it applies (#4566) 2018-06-05 11:58:47 -04:00
Dan Abramov
6370e40aad Temporarily remove doc section on webpack analyzer (#4564) 2018-06-05 14:58:06 +02:00
Jack Zhao
a98c3df3bb Merge pull request #3945 from joshwcomeau/bundle-stats
Allow bundles to be analyzed with Webpack-specific tools
2018-06-04 01:10:47 -07:00
Josh Comeau
80b24d54d9 Remove outdated bit from README, update bundle-analyzer link 2018-06-03 09:04:11 -04:00
Jack Zhao
76ef9fadb6 Merge pull request #4014 from viankakrisna/enable-manifest-plugin-on-dev
enable manifest plugin on dev
2018-05-31 10:26:38 -07:00
Joshua Comeau
7c85938458 Create a --stats flag for react-scripts build. Update README.
To analyze Webpack bundles, a "stats" JSON is required.

This PR allows that file to be created and saved to the `build`
directory, so that users can use it with Webpack-specific insight
tools like `webpack-bundle-analyzer` without ejecting their
application.

Updated the README to include details for how to do this.
2018-05-31 07:23:13 -04:00
Jack Zhao
581c453610 Scope hoisting in webpack 4 (#4504) 2018-05-24 18:32:06 -04:00
Graeme
61c864c38a Update paths.js, rename shadow path variable (#4435)
* Update paths.js, rename shadow path variable

This file requires the "path" module and sets it to a variable `path`. The function `ensureSlash` also has a variable `path` that then shadows the `path` module.

* Update paths.js
2018-05-22 21:11:20 -06:00
Saimon Moore
86a82b1626 Update docs about High Sierra npm test issues (#4497) 2018-05-22 10:19:25 -06:00
Luis Nell
0dfc6f6e07 Update node-sass-chokidar docs (#4205)
* Removes Chokidar Recursive Flag

According to the changelog it is not necessary anymore as it doesn't do anything.

* Removes initial build on SCSS watch

Chokidar now does this on it's own.

* Removes sass watch recursive, default include-path

as proposed by @michaelwayman

* Removes another left-over build-css
2018-05-20 23:31:26 +01:00
Craig Mulligan
0e0f260e35 .mjs should not resolve before .js files (#4085) (#4318)
Support for .mjs files added in #3239 did not account for npm libraries which ship native mjs files alongside js files. This accounts for this by ensuring .js files resolve before their accompanying .mjs file. Note that this is not an ideal end state since selecting a .mjs over a .js extension should be the result of whether `import` was used instead of `require()` in a node environment with native ESM support (currently via `--experimental-modules`). Instead, this change just *always* selects a .js extension before the .mjs extension if it exists.

This unbreaks support for using GraphQL (relay, apollo, etc) within create-react-app projects.
2018-05-20 20:27:31 +01:00
Jack Zhao
d1454febd1 Webpack4 (#4490)
* - [x] Upgrade to webpack 4.8.X
- [x] Utilize webpack 4 development and production modes
- [x] Upgrade webpack dev server
- [x] Webpack 4 compatible release of thread-loader
- [x] Webpack 4 compatible release of HtmlWebpackPlugin
- [x] Webpack 4 compatible release of SwPrecacheWebpackPlugin
- [x] Webpack 4 compatible release of WebpackManifestPlugin
- [x] Update README
- [x] Update WebpackDevServerUtils
- [x] Update InterpolateHtmlPlugin
- [x] Update ModuleScopePlugin
- [x] Update WatchMissingNodeModulesPlugin
- [x] Move UglifyJS options to webpack 4 optimize
- [x] Move InterpolateHtmlPlugin to make it tapable on HtmlWebpackPlugin
- [x] vendor splitting via splitChunks.splitChunks (https://twitter.com/wSokra/status/969633336732905474)
- [x] long term caching via splitChunks.runtimeChunk (https://twitter.com/wSokra/status/969679223278505985)
- [x] Make sure process.env.NODE_ENV is proxied correctly to `react-error-overlay`
- [x] Implicit webpack.NamedModulesPlugin in dev config as its default in webpack 4
- [x] Disable webpack performance hints as we have our own filesize reporter
- [x] Replace ExtractTextPlugin with MiniCssExtractPlugin
- [x] Switch to css whole file minification via OptimizeCSSAssetsPlugin rather than per module css minification to gain performance

* disable module concatenation

* fix cleanup

* fix optimization

* restore tmp removal

* preserve

* fix css tests

* fix test run

* fix svg test

* revert tmp dir

* fix import

* fix import

* help debugging

* fix tests

* fix sass test

* restore cleanup
2018-05-20 18:25:57 +01:00
Andreas Cederström
d72678fb0c - [x] Upgrade to webpack 4.8.X (#4077)
- [x] Utilize webpack 4 development and production modes
- [x] Upgrade webpack dev server
- [x] Webpack 4 compatible release of thread-loader
- [x] Webpack 4 compatible release of HtmlWebpackPlugin
- [x] Webpack 4 compatible release of SwPrecacheWebpackPlugin
- [x] Webpack 4 compatible release of WebpackManifestPlugin
- [x] Update README
- [x] Update WebpackDevServerUtils
- [x] Update InterpolateHtmlPlugin
- [x] Update ModuleScopePlugin
- [x] Update WatchMissingNodeModulesPlugin
- [x] Move UglifyJS options to webpack 4 optimize
- [x] Move InterpolateHtmlPlugin to make it tapable on HtmlWebpackPlugin
- [x] vendor splitting via splitChunks.splitChunks (https://twitter.com/wSokra/status/969633336732905474)
- [x] long term caching via splitChunks.runtimeChunk (https://twitter.com/wSokra/status/969679223278505985)
- [x] Make sure process.env.NODE_ENV is proxied correctly to `react-error-overlay`
- [x] Implicit webpack.NamedModulesPlugin in dev config as its default in webpack 4
- [x] Disable webpack performance hints as we have our own filesize reporter
- [x] Replace ExtractTextPlugin with MiniCssExtractPlugin
- [x] Switch to css whole file minification via OptimizeCSSAssetsPlugin rather than per module css minification to gain performance
2018-05-20 18:22:24 +01:00
Mike Kusold
493a379c21 Map (css|sass|scss) modules to identity-obj-proxy in jest (#4419) 2018-05-15 21:03:22 -04:00
Ian Sutherland
69cc07f2e3 Update svgr (#4461)
* Update svgr to 1.9.2 in order to reduce install size
2018-05-14 14:43:47 -06:00
William Chargin
3aaddefc51 ensureSlash: Fix accidental string-to-NaN coercion (#4424)
Summary:
The `hasSlash` method uses `path.substr(path, path.length - 1)` to
remove the last character from `path`. Clearly, the first parameter is
suspect; it should be `0`. The code works as written, but only very
accidentally: the first parameter is coerced by `ToNumber` to `NaN`,
which is then coerced by `ToInteger` to `+0`, per [the spec][1].

[1]: https://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.substr

Test Plan:
Reading the spec should be sufficient. To verify in the Real World:
```js
const path = "has-slash-but-does-not-need-slash/"
const a = path.substr(path, path.length - 1);
const b = path.substr(0, path.length - 1);
console.log(a === b);  // true
console.log(a);        // has-slash-but-does-not-need-slash
```

wchargin-branch: ensureslash-accidental-coercion
2018-05-08 19:31:25 -04:00
arianon
e5e9f59a4e Update getCSSModuleLocalIdent to support Sass (#4391)
* Update getCSSModuleLocalIdent to support Sass

* Fix Sass/SCSS index module tests

Also make them more consistent with the non-index variants.
2018-05-08 13:07:41 -04:00
Mikhail Osher
458336bef6 Update sass-loader to 7.0.1 (#4376)
* Update sass-loader (#4363)

* Added bootstrap scss test (#4376)
2018-04-27 18:32:20 -06:00
Andreas Cederström
cc36849ca8 fix broken css module support in prod (#4361) 2018-04-27 08:04:51 +02:00
Chad Greenburg
32eebfeb7f Bumped jest version to 22.4.1 (#4362)
* Updated jest version.
2018-04-27 08:04:21 +02:00
Andreas Cederström
0fe6fea6e4 bump babel 7 to beta 46 2018-04-27 07:53:56 +02:00
wtgtybhertgeghgtwtg
66cc7a903e Bump fsevents. (#4331) 2018-04-20 23:51:55 -04:00
Fabiano Brito
bf3d73c2c6 Add Sass loader (#4195)
* Installs and adds sass loader task in webpack for dev environment.

* Uses Timer's branch of sass-loader without node-sass dependency.

* Adds method for handling SASS modules.

* Fixes extension of excluded files when looking for scss modules.

* Adds support for both .scss and .sass extensions.

* Uses ExtractTextPlugin with sass-loader to bundle styles for the production build.

* Bundles SASS modules for the production build.

* Uses the latest version of sass-loader.

* Adds function to create different rules for style loaders in dev environment.

* Abstracts style loaders to a common function to avoid repetition.

* Simplifies the common function that creates style loaders.

* Creates assets for testing SASS/SCSS support.

* Creates mock components and unit tests for SASS and SCSS with and without modules.

* Creates integration tests for SASS/SCSS support.

* Adds node-sass as a template dependency so sass-loader can be tested.

* Includes sass tests when test component is mounted.

* Fixes asserted module name for sass and scss modules tests.

* Removes tests against css imports in SCSS and SASS files.

* Updates sass-loader to v7.

* Uses getCSSModuleLocalIdent from react-dev-utils.

* Fixes tests to match the use of getCSSModuleLocalIdent.

* Improves readability of getStyleLoader function.

* Uses postcss after sass.

* Refactors dev config to simplify common function for style loaders.

* Refactors prod config to simplify common function for style loaders.

* Use importLoaders config according to css-loader docs.
2018-04-18 10:35:55 -06:00
Antti Ahti
836bb39394 Fix some typos in README.md (#4286) 2018-04-15 11:59:47 -04:00
Tom Coleman
92b79b3215 Added learnstorybook.com to Storybook links (#4298)
Learnstorybook is a tutorial for Storybook that both uses CRA and is at a level of introductionary detail appropriate for CRA users.
2018-04-15 11:57:11 -04:00
Jerry Muzsik
fc2f63a238 Document multiple build environments via env-cmd #4071 (#4117)
* Docs - Document multiple build environments via

* Docs - Document multiple build environments via

* Docs - Document multiple build environments via

* Docs - Document multiple build environments via env-cmd

* fix - based upon requests

* Update README.md
2018-04-15 11:52:43 -04:00
Francis Upton IV
14f4485aeb Fixed link to CSS imports blog post 2018-04-13 16:06:57 -06:00
Ro Savage
ae2cf07249 Update CSS Modules localIndetName (#4192)
* Update CSS Modules localIndetName

* Add missing file to package

* Correct regex

* plz plz plz
2018-04-13 16:14:31 -04:00
Andreas Cederström
06176e1ea4 bump babel 7 beta (#4253) 2018-04-05 07:28:30 +02:00
Andreas Cederström
7966139635 Small typo fix #4217 2018-04-04 08:46:15 +02:00
Dan Abramov
3b102fe1b9 Work around Jest environment resolving bug (#4247) 2018-04-03 18:44:59 +01:00
Vicente Plata
061d1e46fc Add troubleshooting for Github Pages (#4197)
Add troubleshooting for an issue that has to do with either 2FA, or using Windows, or both, when trying to deploy an app via gh-pages
2018-04-03 00:51:58 +01:00
Plortinus
9c3f03cac7 use the lastest url of gitignore file (#4236)
* use the lastest url of gitignore file

* Update gitignore
2018-04-02 15:19:28 -04:00
Daniel
9a99b5d190 Fix typo and be clearer about ecma settings in uglifyjs options (#4239) 2018-04-02 15:17:24 -04:00
Daniel
2824bf2e15 [next] Revert to use ecma 5 in uglifyOptions (#4234)
* Revert to use ecma 5 in uglifyOptions

* remove explicit ecma version from uglifyOptions settings

The defaults are already what we want

* be explicit of where we use ecma: 8 and ecma: 5
2018-04-02 13:30:30 -04:00
bradfordlemley
9c167a4249 Add some stuff that requires transpilation. (#4174) 2018-03-25 21:14:59 -04:00
Ian Sutherland
8a34b7cc77 Add ESLint check for incorrect propTypes usage (#3840) (#4048) 2018-03-25 16:17:41 -06:00
bradfordlemley
058d03f8f8 Fix typos in example monorepo documentation. (#4164) 2018-03-21 17:42:30 -04:00
Brian Ng
cb3f835586 Bump babel-related deps (#4159)
* Add explicit dep on plugin-proposal-object-rest-spread to babel-preset-react-app

* Bump babel-related deps to beta.42

* Pass useBuiltIns directly to react-preset
2018-03-18 14:22:56 -06:00