Skip to content

Commit 13ad54b

Browse files
committedDec 1, 2020
ssr-recipe complete
1 parent a4f45fa commit 13ad54b

17 files changed

+396
-299
lines changed
 

‎ssr-recipe/.eslintcache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\App.js":"1","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Red.js":"2","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Blue.js":"3","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\RedPage.js":"4","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\index.js":"5"},{"size":528,"mtime":1606643079488,"results":"6","hashOfConfig":"7"},{"size":153,"mtime":1606649279853,"results":"8","hashOfConfig":"7"},{"size":157,"mtime":1606649275593,"results":"9","hashOfConfig":"7"},{"size":149,"mtime":1606644800930,"results":"10","hashOfConfig":"7"},{"size":522,"mtime":1606645024735,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1eowj0q",{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\App.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Red.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Blue.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\RedPage.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\index.js",[]]
1+
[{"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\App.js":"1","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Red.js":"2","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Blue.js":"3","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\RedPage.js":"4","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\index.js":"5","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\containers\\UsersContainer.js":"6","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\modules\\users.js":"7","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\User.js":"8","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\lib\\PreloadContext.js":"9","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Menu.js":"10","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\modules\\index.js":"11","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\containers\\UserContainer.js":"12","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\UsersPage.js":"13","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Users.js":"14","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\BluePage.js":"15","C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\reportWebVitals.js":"16"},{"size":640,"mtime":1606791179776,"results":"17","hashOfConfig":"18"},{"size":153,"mtime":1606649279853,"results":"19","hashOfConfig":"18"},{"size":157,"mtime":1606649275593,"results":"20","hashOfConfig":"18"},{"size":149,"mtime":1606644800930,"results":"21","hashOfConfig":"18"},{"size":1354,"mtime":1606792027866,"results":"22","hashOfConfig":"18"},{"size":753,"mtime":1606789086135,"results":"23","hashOfConfig":"18"},{"size":2908,"mtime":1606744672676,"results":"24","hashOfConfig":"18"},{"size":335,"mtime":1606789368459,"results":"25","hashOfConfig":"18"},{"size":724,"mtime":1606789506289,"results":"26","hashOfConfig":"18"},{"size":420,"mtime":1606744616920,"results":"27","hashOfConfig":"18"},{"size":275,"mtime":1606743410478,"results":"28","hashOfConfig":"18"},{"size":815,"mtime":1606789520555,"results":"29","hashOfConfig":"18"},{"size":433,"mtime":1606744568527,"results":"30","hashOfConfig":"18"},{"size":528,"mtime":1606788963895,"results":"31","hashOfConfig":"18"},{"size":155,"mtime":1606644848115,"results":"32","hashOfConfig":"18"},{"size":362,"mtime":1606643079488,"results":"33","hashOfConfig":"18"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1eowj0q",{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"41"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"41"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"57"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"38"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\App.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Red.js",[],["70","71"],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Blue.js",[],["72","73"],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\RedPage.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\index.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\containers\\UsersContainer.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\modules\\users.js",[],["74","75"],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\User.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\lib\\PreloadContext.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Menu.js",[],["76","77"],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\modules\\index.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\containers\\UserContainer.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\UsersPage.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\components\\Users.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\pages\\BluePage.js",[],"C:\\Users\\Sungmin\\Desktop\\WEB\\ReactStudy\\ssr-recipe\\src\\reportWebVitals.js",[],{"ruleId":"78","replacedBy":"79"},{"ruleId":"80","replacedBy":"81"},{"ruleId":"78","replacedBy":"82"},{"ruleId":"80","replacedBy":"83"},{"ruleId":"78","replacedBy":"84"},{"ruleId":"80","replacedBy":"85"},{"ruleId":"78","replacedBy":"86"},{"ruleId":"80","replacedBy":"87"},"no-native-reassign",["88"],"no-negated-in-lhs",["89"],["88"],["89"],["88"],["89"],["88"],["89"],"no-global-assign","no-unsafe-negation"]

‎ssr-recipe/config/webpack.config.js

+12-9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
2626
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
2727
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
2828
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
29+
const LoadablePlugin = require('@loadable/webpack-plugin');
2930

3031
const postcssNormalize = require('postcss-normalize');
3132

@@ -213,12 +214,13 @@ module.exports = function (webpackEnv) {
213214
publicPath: paths.publicUrlOrPath,
214215
// Point sourcemap entries to original disk location (format as URL on Windows)
215216
devtoolModuleFilenameTemplate: isEnvProduction
216-
? info =>
217+
? (info) =>
217218
path
218219
.relative(paths.appSrc, info.absoluteResourcePath)
219220
.replace(/\\/g, '/')
220221
: isEnvDevelopment &&
221-
(info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
222+
((info) =>
223+
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
222224
// Prevents conflicts when multiple webpack runtimes (from different apps)
223225
// are used on the same page.
224226
jsonpFunction: `webpackJsonp${appPackageJson.name}`,
@@ -301,7 +303,7 @@ module.exports = function (webpackEnv) {
301303
// https://twitter.com/wSokra/status/969679223278505985
302304
// https://github.com/facebook/create-react-app/issues/5358
303305
runtimeChunk: {
304-
name: entrypoint => `runtime-${entrypoint.name}`,
306+
name: (entrypoint) => `runtime-${entrypoint.name}`,
305307
},
306308
},
307309
resolve: {
@@ -319,8 +321,8 @@ module.exports = function (webpackEnv) {
319321
// `web` extension prefixes have been added for better support
320322
// for React Native Web.
321323
extensions: paths.moduleFileExtensions
322-
.map(ext => `.${ext}`)
323-
.filter(ext => useTypeScript || !ext.includes('ts')),
324+
.map((ext) => `.${ext}`)
325+
.filter((ext) => useTypeScript || !ext.includes('ts')),
324326
alias: {
325327
// Support React Native Web
326328
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
@@ -404,7 +406,7 @@ module.exports = function (webpackEnv) {
404406
},
405407
],
406408
],
407-
409+
408410
plugins: [
409411
[
410412
require.resolve('babel-plugin-named-asset-import'),
@@ -449,7 +451,7 @@ module.exports = function (webpackEnv) {
449451
cacheDirectory: true,
450452
// See #6846 for context on why cacheCompression is disabled
451453
cacheCompression: false,
452-
454+
453455
// Babel sourcemaps are needed for debugging into node_modules
454456
// code. Without the options below, debuggers like VSCode
455457
// show incorrect code and set breakpoints on the wrong lines.
@@ -554,6 +556,7 @@ module.exports = function (webpackEnv) {
554556
],
555557
},
556558
plugins: [
559+
new LoadablePlugin(),
557560
// Generates an `index.html` file with the <script> injected.
558561
new HtmlWebpackPlugin(
559562
Object.assign(
@@ -650,7 +653,7 @@ module.exports = function (webpackEnv) {
650653
return manifest;
651654
}, seed);
652655
const entrypointFiles = entrypoints.main.filter(
653-
fileName => !fileName.endsWith('.map')
656+
(fileName) => !fileName.endsWith('.map')
654657
);
655658

656659
return {
@@ -745,4 +748,4 @@ module.exports = function (webpackEnv) {
745748
// our own hints via the FileSizeReporter
746749
performance: false,
747750
};
748-
};
751+
};

0 commit comments

Comments
 (0)
Please sign in to comment.