Commit Graph

60 Commits

Author SHA1 Message Date
Sophie Alpert
2e82ebb337 BSD+Patents -> MIT (#3189)
* File headers BSD+Patents -> MIT

* BSD+Patents -> MIT
2017-09-26 10:30:05 +01:00
Kristie Howard
b67ef01ade Update unclear wording in webpack config docs (#3160) 2017-09-19 22:00:44 -04:00
Anthony
6644054fc3 provide empty mock for child_process so importing libraries with it works (#3033) 2017-09-02 13:41:40 -07:00
Tharaka Wijebandara
1df16109c9 Fix error overlay 'Object.assign' issue in IE by including polyfills before webpack client (#3046) 2017-09-01 12:54:58 -07:00
Tharaka Wijebandara
ecd1f0544b Convert react-error-overlay to React (#2515)
* Convert react-error-overlay to React

* Update compile-time error overlay to use react-error-overlay components

 * Refactor react-error-overlay components to container and presentational components.

 * Make the compile-time error overlay a part of react-error-overlay package.

 * Use react-error-overlay as dependency in react-dev-utils to show compile-time errors.

* Run Prettier

* Move the function name fix into StackFrame itself

* Fix clicking on source code snippet to open the code in editor

* Use exact objects + minor style tweak

* Don't linkify frames that don't exist on the disk

* Fix lint

* Consolidate iframe rendering logic

* Remove circular dependency between react-dev-utils and react-error-overlay

* Fix lint

* Fix decoupling of react-dev-utils and react-error-overlay by moving middleware

* Deduplicate identical errors
2017-08-27 19:45:55 -06:00
iamdoron
24b18aedd9 Allow importing package.json (#2468)
* Allow importing package.json

* Remove package.json import from App.js template

* fix importing package.json

* Rename variable to reflect path is relative to root

* Check for both package & package.json in ModuleScopePlugin

* Use regex to check relative path to package.json

* Strictly enforce package.json extension on scope plugin

* Add allowedPaths to ModuleScopePlugin ctor and use it to allow app package.json

* Remove package.json import from App.js template

* Add package.json to react-scripts/template, show package version and name in the template

* Remove import package.json from template

* Remove template/package.json and its references in code

* Update ModuleScopePlugin.js

* Update README.md
2017-08-01 22:50:58 -04:00
Andreas Hoffmann
a08eb3b44b Use Rule.oneOf to resolve correct loader (#2747)
* Use oneOf to resolve correct loader

* Add html and json fallthrough again

* Use oneOf to resolve correct loader in dev

* Document file-loaders `js` exclusion

* Remove `jsx` from exclusion in prod config
2017-07-09 21:59:19 +01:00
Đinh Quang Trung
bbbc15dc8e ESLint 4 (#2735)
* Update eslint-loader 1.7.1 -> 1.9.0

* Add eslintPath option

* Update eslint 3.19.0 -> 4.1.1

* Update peer dependencies

* Move eslintPath config to outside @remove-on-eject
2017-07-07 11:40:29 +01:00
Dan Abramov
567d981ee2 Fix external CSS imports (#2680)
* Fix external CSS imports

* Add external CSS import to integration test

* Fix assertion
2017-06-29 12:59:49 +01:00
Evan Jones
6ab0ec0075 Better React Native Web support (#2511)
* Better React Native Web support

* Adding better react-native-web support for jest testing
2017-06-28 15:29:58 +01:00
Daniel Ciao
a9ac78996b Fix sourcemap directory organizing on Windows (#2456) (#2610)
* Fix sourcemap directory organizing on Windows

* Update comments
2017-06-27 16:55:28 +01:00
Andy Kenward
43d0307bc1 webpack no need for ident if using complex options anymore (#2430)
Since `v2.2.1` of webpack the need for `ident` for complex options is no longer required. See

https://webpack.js.org/guides/migrating/#complex-options
2017-06-26 17:31:25 +01:00
Mico Piira
6e2898e596 Add empty mock for dgram (#2600) 2017-06-26 16:48:21 +01:00
Zac Kwan
c78c1fae62 Added NamedModulesPlugin in webpack.config.dev.js (#2458)
* Added NamedModulesPlugin in webpack.config.dev.js

* Update webpack.config.dev.js
2017-06-06 14:06:39 +01:00
Dan Abramov
3a3be7478b Fix a bug on empty NODE_PATH (#2264) 2017-05-19 20:06:15 +01:00
Dan Abramov
d24311ea79 Always resolve NODE_PATH (#2261)
* Always resolve NODE_PATH

* Update env.js
2017-05-19 19:55:57 +01:00
Kant
e7c113eb15 Webpack config typo (#2193)
* Webpack config typo

* Webpack config more typo
2017-05-17 14:30:07 +01:00
Joe Haddad
a61be9c619 Add module scope plugin (#2189)
* Add module scope plugin

* Oops

* Add comments

* Check windows seps too

* More descriptive error

* Document it
2017-05-17 12:19:52 +01:00
Dan Abramov
65ff5481d9 Ignore Moment.js locales by default (#2187)
* Ignore Moment.js locales by default

* Update README.md
2017-05-16 23:59:48 +01:00
Dan Abramov
134d2297dd Reenable require.ensure() 2017-05-16 16:10:10 +01:00
Dan Abramov
50aaae6c1c Resolve regenerator runtime relative to react-scripts (#2175) 2017-05-16 15:40:16 +01:00
Cristian
044e57b726 Adding plugin postcss-flexbugs-fixes and flexbox: 'no-2009' to Autoprefixer (#1771)
* Adding postcss-flexbugs-fixes

Using postcss-flexbugs-fixes to fix all flexbug's issues.

* Adding flexbox: 'no-2009' to Autoprefixer

It will add flexbox prefixes only for final and IE versions of
specification.
2017-05-16 01:02:38 +01:00
Dan Abramov
d6dbfc0353 Support hoisting react-scripts and add require.resolve() to loaders (#2166)
* Support hoisting react-scripts

* require.resolve() loaders and configs

This makes it so that loaders and configs are resolved relative to the config rather than to the app. This seems to make more sense to me.
2017-05-15 23:47:28 +01:00
Siddharth Doshi
f17448e9e5 Add custom eslint formatter (#2138)
* Add custom eslint formatter

* Add formatter docs

* Update formatter docs

* Slightly tweak it

* Update README.md
2017-05-15 00:42:13 +01:00
Joe Haddad
76d2d848c6 Improve unmapper file heuristic, add limited warning support, and ignore internal errors (#2128)
* Browser sort is not stable

* Fix ordering of final message

* Register the warning capture

* Display only createElement warnings

* Use different method name

* Fix regression

* Ignore errors with only node_module files

* Ignore null files, too

* Revise count

* Revise warning

* Update overlay.js

* Add support for https://github.com/facebook/react/pull/9679

* Use absolute paths

* Trim path if it's absolute

* Make sure it's an absolute path

* Oops

* Tweak for new behavior

* Make it safer

* More resilient warnings

* Prettier output

* Fix flow
2017-05-13 14:39:32 +01:00
Joe Haddad
70768b321e Add react-error-overlay package (#2111)
* ༼ つ ◕_◕ ༽つ stack-frame-overlay

* Fix linting

* Remove auto overlay

* Fix e2e

* Pull in the rest

* Appease flow

* Correct dep

* Remove old repo references

* Check flow on test

* Test overlay in e2e

* Add cross env

* Rename package

* Make sure it gets built post-install

* Update the README

* Remove extra builds now that there's a postinstall script

* Revert "Remove extra builds now that there's a postinstall script"

This reverts commit 8bf601dbd36c1e0da7f785fa9ade70ab08ed8772.

* Remove broken script

* Fix some dev ergo
2017-05-10 19:56:30 -04:00
Joe Haddad
1acc3a45f1 Do not parse .eslintignore (#2115) 2017-05-10 19:24:51 -04:00
Jeremy Stucki
3fac03664c Define dev chunk names (#2050)
* Define dev chunk names

Fixes #2046

* Add comment
2017-05-01 13:01:37 +01:00
Joe Haddad
88f4f95ae8 Upgrade webpack deps and use strictExportPresence (#2028) 2017-04-25 10:36:18 +01:00
Joe Haddad
927c539bc5 Use custom sourcemap file names 2017-04-24 21:51:59 -04:00
Asa Ayers
47a8148fb1 Fix importing npm linked libraries (#1359)
* Fix importing npm linked libraries

* Update webpack.config.dev.js

* Update webpack.config.prod.js
2017-03-22 20:29:53 -04:00
Dan Abramov
ccb5f84dc6 Fixes a silent crash when ejecting (#1810)
* Fixes a silent crash when ejecting

* Delete unnecessary files

* Remove references to eslintrc in Webpack config

* Fix lint

* Correct ESLint CLI options
2017-03-14 11:17:53 -04:00
Valerii Sorokobatko
fe7b5c212b update to modern code style (#1738)
* mv create-react-app/index.js -> create-react-app/creteReactApp.js

* update to modern code style

* var -> cosnt

* set trailing-coma to es5 for prettier
2017-03-07 19:46:10 +00:00
Rory Hunter
2ac1b38ec6 Whitelist files that can be embedded through url-loader (#1305)
* Whitelist files that can be embedded through url-loader

Change the current catch-all loader to use file-loader instead of
url-loader, and exclude common image file extensons. Add another url-loader
for images, configured identically to the original catch-all loader.

Part of issue #1293.

* Update tests to reflect change in loader config

* Integration test fix

* More CI fixes

* Work around broken loader-utils behaviour in integration tests

* Revise the documentation around file loading

* Documentation tweaks

* Docs tweak

* Update test now that webpack/loader-utils has been updated

* Update react-scripts to depend on babel-loader@7.0.0-alpha.2

* Bump deps
2017-03-07 01:24:56 -05:00
Joe Haddad
ed5c016d61 Add runtime error overlay (#1101)
* Add red box prototype

* Unmount fail node when hot-reloaded (future proofing)

* Slightly improve error reason

* Add Chrome unhandledrejection listener

* Close red box when Escape is pressed

* Construct our own source if not available

* Resolve sourcemaps for friendlier traces

* Allow error to be scrolled

* Only utilize sourcemaps, not the magic. :(

* Make view similar to React Native

* Fix an uncaught syntax error

* Add workaround for Firefox 50

* Add a hint for closing the prompt

* Multiple error support
When there's multiple errors, simply state that there are more instead of re-rendering

* Log any renderer error

* Dim node_modules in display

* Override chrome stack trace limit

* Magic: show me some source!

* Add ability to toggle internal calls

* Switch text from show -> hide

* Change color scheme to something easier on the eyes

* Change UI to be friendlier (thanks @nicinabox)
https://github.com/facebookincubator/create-react-app/pull/1101#issuecomment-263621057
https://github.com/facebookincubator/create-react-app/pull/1101#issuecomment-263636171

* Update styles

* Add container inside overlay

* Apply pre style

* Add line highlight

* Add omitted frames ui

* Move yellow to var

* Do all function names in black

* Adapt container based on screen size

* Extract ansiHTML

Use base16-github theme

* Linting

* Add syntax highlighting of errors

* Linting

* Remove white background

* Append new files to package.json

* Target exact version

* White is a little harsh, use same color as red box.

* Fix a bug where omitted frames would never be rendered
(under certain circumstances)

* Show local file path instead of confusing webpack://

* Do not require the entire file

* Remove css file

* Use context size, not a magic variable.

* Fix title regression

* Update dependency

* Do not center text for internal calls

* Temporarily disable links

* Switch internal toggle to 'i'

* Remove unnecessary rules from container style

* Reduce omitted frames font size

* Fix font family in pre > code

* Re-introduce line highlighting

* Object.<anonymous> -> (anonymous function)

* Add ability to see script source

* Add missing ansi mappings

* Remove SIAF

* Skip native functions

* Extract hints div function

* Extract renderers

* Refacor var names

* If source is disabled, don't use the line.

* Allow toggle between source

* Allow bundles to be expanded

* Wow, how did I let this one slip?

* Toggle text for UX/DX

* Make it so clicking Close unmounts the error component

* Do not allow hot reloading once an error is thrown

* Do not wrap lines for small displays

* Fix toggle when additional errors happen

* Make the close a button

* Capture and store errors

* Dispose on render; move additional logic

* Only make code not wrap

* Switch to a view-by-index method

* Allow user to switch between errors with arrow keys

* Fix text while switching between errors

* Update close button style

* Render additional errors at top

* Add left and right arrows

* Make frames pointy

* UTF-8 arrows

* Don't mount unneeded DOM node

* Switch to single changing text for compiled <-> source

* Don't display arrows with only one error.

* Collapsed and expanded

* Make sure the last collapse toggle is appended

* Do not show the stack trace if it doesn't resolve to a file we wrote

* Style container with media queries

* Do not allow x overflow; break words by default.

* Trim off whitespace of lines

* Remove padding since it's not outer-most

* Add footer message

* Extract css file to JS

* Only inject the css when the overlay is up

* Extract red variable

* Remove env

* Update babel-code-frame

* Set force color to true

* Extract out collapse div logic

* Remove arrow field

* Insert a top collapse

* Make browser friendlier

* Absolutify ^

* Make arrows buttons

* Accessify

* Let there be ES5

* Pretty css

* Use forEach where we can ...

* Remove extracted loop

* Fix IE compatibility

* Capture React warnings

* Add source override via React output parsing

* Whoops, fix arguments to crash.

* es5-ify

* Re-enable e2e-install directory test

* Only rewrite line number if it was resolved and leaves a line at bottom

* Rename failFast to crashOverlay

* Disable console proxy

* Appease linter

* Appease more
2017-03-06 21:59:57 -05:00
Dan Abramov
1bfd5dafdf Fix internal linting setup and add missing headers (#1741) 2017-03-06 14:20:29 +00:00
Dan Abramov
7c899fc392 Revert "Enable eslint caching in development" (#1665) 2017-02-28 14:02:45 +00:00
Ade Viankakrisna Fadlil
8d41328342 Enable eslint caching in development (#1578)
* Enable eslint caching in development

POC for https://github.com/facebookincubator/create-react-app/issues/740. Haven't found any problem, build times improved about 1s on my project and machine.

* Bump eslint-loader to 1.6.3

* move @remove-on-eject block to persist cache config on eject
2017-02-24 20:29:25 +00:00
Joe Haddad
fc49946ccb Add support for dynamic import & disable require.ensure (#1538)
* Disable require.ensure

* Replace require.ensure with import

* Add babel plugin for parsing import()

* Get the default

* Upgrade babel-eslint to support dynamic import

* Fix dep

* Update deps
2017-02-14 20:51:23 -05:00
Joe Haddad
12288836e1 Upgrade webpack (#1291)
* Upgrade webpack

* Address more webpack v2 ...

* Update html-webpack-plugin

* Remove LoaderOptionsPlugin from dev config

* ExtractTextPlugin still uses webpack 1 syntax
... and doesn't support complex options (yet)

* Grammar nit

* Update extract text webpack plugin

* - Remove webpack.LoaderOptionsPlugin
- Update deps

* Lerna hoists packages

* Update extract-text-webpack-plugin

* Update webpack-dev-server

* Remove imports for the tests

* stop removing babelrc
2017-02-11 14:11:00 -05:00
Joe Haddad
613b584f42 Add PUBLIC_URL env variable for advanced use (#937) (#1504)
* Add `PUBLIC_URL` env variable for advanced use (#937)
* Add support for `PUBLIC_URL` env variable
* Remove unnecessary duplications
* Simplify served path choice logic
* Honor PUBLIC_URL in development
* Add e2e tests

Enables serving static assets from specified host.
2017-02-09 23:15:15 -05:00
Jih-Chi Lee
1d9159de23 Make all react app vars accessible in index.html (#1440)
* Make all vars accessiable in index.html

* Fix wrong env provieded to DefinePlugin

* Separate results from getClientEnvironment

* The `string` should be object instead of string

* Fix accessing wrong field

* Changed variables naming to `raw` and `stringified`

* Remove trailing commas
2017-02-09 22:41:03 -05:00
Ro Savage
0ac0d116b9 Update comments for webpack loaders 2017-02-09 11:21:02 +13:00
Bogdan Soare
15feb02e9c Use file-loader for svgs (#1180) 2016-12-06 16:07:50 +00:00
Harun
80765677d5 Remove path module from webpack config on eject. (#1175)
* Remove path module from webpack config on eject.

Fixes #1174

* Move path module inclusion right after the other imports

Re: #1174
2016-12-06 11:17:18 +00:00
Stefan
6e00813632 Adapt jest and eslint for new default loader scope. (#1077)
Revert webpack prod config comments to not refer to dev server.
2016-11-22 00:03:40 +02:00
Stefan
058b2cc887 exclude html from default loader. (#1075) 2016-11-21 13:57:21 +02:00
Stefan
1c622ec34f Use url-loader with limit 10k as a default loader. (#1059)
Loads all files not already handled by other loaders.
Also, switch image loading from file loader to url-loader.
2016-11-21 00:00:10 +02:00
ekaradon
e14d2da4fc fix poor performance with firefox when using eval as devtool (#924)
Enable sourcemaps in development
2016-11-20 17:24:54 +00:00
Ville Immonen
6bda4b9726 Remove custom babel-loader cache dir config (#983)
Upgrade `babel-loader` and remove the cache directory configuration
that was added in #620. `babel-loader` now uses the
`./node_modules/.cache/babel-loader` directory by default, so the
custom config is no longer needed.
2016-10-29 20:00:16 +01:00