Skip to content

Commit 44df4d7

Browse files
bebbialexdriaguine
authored andcommitted
Adapt jest and eslint for new default loader scope. (facebook#1077)
Revert webpack prod config comments to not refer to dev server.
1 parent b10f7e5 commit 44df4d7

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

packages/eslint-config-react-app/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ module.exports = {
4343

4444
settings: {
4545
'import/ignore': [
46-
'node_modules',
47-
'\\.(json|css|ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$',
46+
'node_modules'
4847
],
4948
'import/extensions': ['.js'],
5049
'import/resolver': {

packages/react-scripts/config/webpack.config.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ module.exports = {
124124
// A missing `test` is equivalent to a match.
125125
{
126126
exclude: [
127-
/\.(html)$/,
127+
/\.html$/,
128128
/\.(js|jsx)$/,
129129
/\.css$/,
130130
/\.json$/

packages/react-scripts/config/webpack.config.prod.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,13 @@ module.exports = {
124124
// we need to add the supported extension to this loader too.
125125
// Add one new line in `exclude` for each loader.
126126
//
127-
// "file" loader makes sure those assets get served by WebpackDevServer.
128-
// When you `import` an asset, you get its (virtual) filename.
129-
// In production, they would get copied to the `build` folder.
130-
// "url" loader works like "file" loader except that it embeds assets
131-
// smaller than specified limit in bytes as data URLs to avoid requests.
132-
// A missing `test` is equivalent to a match.
127+
// "file" loader makes sure those assets end up in the `build` folder.
128+
// When you `import` an asset, you get its filename.
129+
// "url" loader works just like "file" loader but it also embeds
130+
// assets smaller than specified size as data URLs to avoid requests.
133131
{
134132
exclude: [
135-
/\.(html)$/,
133+
/\.html$/,
136134
/\.(js|jsx)$/,
137135
/\.css$/,
138136
/\.json$/

packages/react-scripts/utils/createJestConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
2020
const config = {
2121
collectCoverageFrom: ['src/**/*.{js,jsx}'],
2222
moduleNameMapper: {
23-
'^.+\\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': resolve('config/jest/FileStub.js'),
23+
'^.+\\.(?!(js|jsx|css|json)$)[^\\.]+$': resolve('config/jest/FileStub.js'),
2424
'^.+\\.css$': resolve('config/jest/CSSStub.js')
2525
},
2626
setupFiles: [resolve('config/polyfills.js')],

0 commit comments

Comments
 (0)