Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 99 additions & 67 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions packages/react-dev-utils/FileSizeReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ var stripAnsi = require('strip-ansi');
var gzipSize = require('gzip-size').sync;

function canReadAsset(asset) {
return (
/\.(js|css)$/.test(asset) &&
!/service-worker\.js/.test(asset) &&
!/precache-manifest\.[0-9a-f]+\.js/.test(asset)
);
return /\.(js|css)$/.test(asset);
}

// Prints a detailed summary of build files.
Expand Down
56 changes: 19 additions & 37 deletions packages/react-dev-utils/WebpackDevServerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ function createCompiler({
}) {
// "Compiler" is a low-level interface to webpack.
// It lets us listen to some events and provide our own custom messages.
let compiler;
let masterCompiler;
try {
compiler = webpack(config);
masterCompiler = webpack(config);
} catch (err) {
console.log(chalk.red('Failed to compile.'));
console.log();
Expand All @@ -125,31 +125,32 @@ function createCompiler({
// recompiling a bundle. WebpackDevServer takes care to pause serving the
// bundle, so if you refresh, it'll wait instead of serving the old one.
// "invalid" is short for "bundle invalidated", it doesn't imply any errors.
compiler.hooks.invalid.tap('invalid', () => {
masterCompiler.hooks.invalid.tap('invalid', () => {
if (isInteractive) {
clearConsole();
}
console.log('Compiling...');
});

let isFirstCompile = true;
let tsMessagesPromise;

if (useTypeScript) {
forkTsCheckerWebpackPlugin
.getCompilerHooks(compiler)
.waiting.tap('awaitingTypeScriptCheck', () => {
console.log(
chalk.yellow(
'Files successfully emitted, waiting for typecheck results...'
)
);
});
}
masterCompiler.compilers.forEach(compiler => {
if (useTypeScript) {
forkTsCheckerWebpackPlugin
.getCompilerHooks(compiler)
.waiting.tap('awaitingTypeScriptCheck', () => {
console.log(
chalk.yellow(
'Files successfully emitted, waiting for typecheck results...'
)
);
});
}
});

// "done" event fires when webpack has finished recompiling the bundle.
// Whether or not you have warnings or errors, you will get this event.
compiler.hooks.done.tap('done', async stats => {
masterCompiler.hooks.done.tap('done', async stats => {
if (isInteractive) {
clearConsole();
}
Expand Down Expand Up @@ -198,6 +199,7 @@ function createCompiler({
chalk.underline(chalk.yellow('keywords')) +
' to learn more about each warning.'
);

console.log(
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
Expand All @@ -206,27 +208,7 @@ function createCompiler({
}
});

// You can safely remove this after ejecting.
// We only use this block for testing of Create React App itself:
const isSmokeTest = process.argv.some(
arg => arg.indexOf('--smoke-test') > -1
);
if (isSmokeTest) {
compiler.hooks.failed.tap('smokeTest', async () => {
await tsMessagesPromise;
process.exit(1);
});
compiler.hooks.done.tap('smokeTest', async stats => {
await tsMessagesPromise;
if (stats.hasErrors() || stats.hasWarnings()) {
process.exit(1);
} else {
process.exit(0);
}
});
}

return compiler;
return masterCompiler;
}

function resolveLoopback(proxy) {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-dev-utils",
"version": "12.0.0",
"name": "@ouihelp-npm/react-dev-utils",
"version": "12000000.0.1",
"description": "webpack utilities used by Create React App",
"repository": {
"type": "git",
Expand Down
24 changes: 24 additions & 0 deletions packages/react-scripts/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ module.exports = {
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveModule(resolveApp, 'src/index'),
appServiceWorkerJs: resolveModule(
resolveApp,
'src/alternative-entrypoints/service-worker/entrypoint'
),
appWebworkerJs: resolveModule(
resolveApp,
'src/alternative-entrypoints/webworker/entrypoint'
),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
appTsConfig: resolveApp('tsconfig.json'),
Expand All @@ -91,6 +99,14 @@ module.exports = {
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveModule(resolveApp, 'src/index'),
appServiceWorkerJs: resolveModule(
resolveApp,
'src/alternative-entrypoints/service-worker/entrypoint'
),
appWebworkerJs: resolveModule(
resolveApp,
'src/alternative-entrypoints/webworker/entrypoint'
),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
appTsConfig: resolveApp('tsconfig.json'),
Expand Down Expand Up @@ -129,6 +145,14 @@ if (
appPublic: resolveOwn(`${templatePath}/public`),
appHtml: resolveOwn(`${templatePath}/public/index.html`),
appIndexJs: resolveModule(resolveOwn, `${templatePath}/src/index`),
appServiceWorkerJs: resolveModule(
resolveOwn,
`${templatePath}/src/alternative-entrypoints/service-worker/entrypoint`
),
appWebworkerJs: resolveModule(
resolveOwn,
`${templatePath}/src/alternative-entrypoints/webworker/entrypoint`
),
appPackageJson: resolveOwn('package.json'),
appSrc: resolveOwn(`${templatePath}/src`),
appTsConfig: resolveOwn(`${templatePath}/tsconfig.json`),
Expand Down
Loading