ssr-plugin-react 6.2.24 → 6.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,225 @@
1
+ ## [6.2.27](https://github.com/zhangyuang/ssr/compare/v6.2.8...v6.2.27) (2022-07-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add build:publish disable sourcemap ([ef82b29](https://github.com/zhangyuang/ssr/commit/ef82b298ddf19b72b130d76c33bfbca67339b139))
7
+ * add prefix output to window.prefix in csr mode ([#197](https://github.com/zhangyuang/ssr/issues/197)) ([479bb3d](https://github.com/zhangyuang/ssr/commit/479bb3df67d7da5635939a4219b5f5f9a40b5508))
8
+ * build html ([83be7be](https://github.com/zhangyuang/ssr/commit/83be7be185985a5dcbb9b8e846a5e2b14b94c1b0))
9
+ * build html ([59a8d7f](https://github.com/zhangyuang/ssr/commit/59a8d7f31bed703601e753d02db49ea5a0f93054))
10
+ * ci ([57e713f](https://github.com/zhangyuang/ssr/commit/57e713f1f96b4ceb893837c15c6032b23a0b1a4c))
11
+ * core-js types ([036bf38](https://github.com/zhangyuang/ssr/commit/036bf385d8ed804dfc2e46ef4484f7bf499d7cdb))
12
+ * don't throw error when load module failed ([2e5d077](https://github.com/zhangyuang/ssr/commit/2e5d077848dc10998a04fcccccc7c745c0d1bea7))
13
+ * fix config htmlTemplate read ([#191](https://github.com/zhangyuang/ssr/issues/191)) ([8c3e12b](https://github.com/zhangyuang/ssr/commit/8c3e12b6adb64b7898bc6232d980e72c5353026b))
14
+ * loadConfig ([8960c84](https://github.com/zhangyuang/ssr/commit/8960c84eea7b384d59ebfe6424813afec433b3f8))
15
+ * lock babel-plugin-import ([72c3041](https://github.com/zhangyuang/ssr/commit/72c3041bf61a1fc9b7593df1fdb6c4dc850c6bbd))
16
+ * lock vite version in plugin-react ([e015b75](https://github.com/zhangyuang/ssr/commit/e015b750c60dcae9a4a7e5fe14937177b80367ca))
17
+ * plugin-react without dynamic mode ([487cc84](https://github.com/zhangyuang/ssr/commit/487cc84188640aab13c27214df758da0d19e4368))
18
+ * postinstall ([fef24ba](https://github.com/zhangyuang/ssr/commit/fef24bada3498f162efd0bdd09921503e44ad21a))
19
+ * postinstall get correct path ([b3d1951](https://github.com/zhangyuang/ssr/commit/b3d1951b7537c5954fd040797fc0011a1d4439d7))
20
+ * react router basename in server entry ([#212](https://github.com/zhangyuang/ssr/issues/212)) ([28072f7](https://github.com/zhangyuang/ssr/commit/28072f7bdfc489a27599b636db33bdea18ef4c18))
21
+ * Recommended to specify used minor core-js version ([#207](https://github.com/zhangyuang/ssr/issues/207)) ([9db0424](https://github.com/zhangyuang/ssr/commit/9db0424e5e7ad1728d40665d01740f7a2c1c4b70))
22
+ * release utils ([1b9c56b](https://github.com/zhangyuang/ssr/commit/1b9c56bc904faa0cae39fb329c02b5d159d69872))
23
+ * restore webpack split chunks config ([2f7ae67](https://github.com/zhangyuang/ssr/commit/2f7ae67ecef863d56752a4a4e1fa7a75ec0756ed))
24
+ * revert vite build ([210ddea](https://github.com/zhangyuang/ssr/commit/210ddea22fc0639f60fcee96bdf47463d188e18f))
25
+ * update preinstall ([2b4b869](https://github.com/zhangyuang/ssr/commit/2b4b869c28b83b414bef10260e5561bc3773cea9))
26
+ * useStore types ([3532bfb](https://github.com/zhangyuang/ssr/commit/3532bfbef9981da300abf748a98925b59cc2c71d))
27
+ * vite mode config.base ([c64aa1a](https://github.com/zhangyuang/ssr/commit/c64aa1ab9d88cdfd7df1cce6feb43b191847e666))
28
+ * **vite:** vite config base use publicPath first in client ([#192](https://github.com/zhangyuang/ssr/issues/192)) ([ef5b145](https://github.com/zhangyuang/ssr/commit/ef5b1451850441b0748727d09144e6e671f71208))
29
+ * vue3 package.json ([c49fb14](https://github.com/zhangyuang/ssr/commit/c49fb146fc6ba79ffbeee567e334b560ffecbcac))
30
+ * whitList concat userconfig ([fdd971a](https://github.com/zhangyuang/ssr/commit/fdd971ab11aebc0f348d789e758183b877e791af))
31
+ * whitList concat userconfig ([e2328f8](https://github.com/zhangyuang/ssr/commit/e2328f87f5cfc18c9a30867e4f6e18d0df5c1ba3))
32
+
33
+
34
+ ### Features
35
+
36
+ * optimize code remove disableClientRender fix vite ([eeff477](https://github.com/zhangyuang/ssr/commit/eeff4770f8d9ff400289cf4d1ca4dd32883be108))
37
+ * add .vue to defaultWhiteList ([dbabfa2](https://github.com/zhangyuang/ssr/commit/dbabfa2864ec0a5487aadc31286da5630a8603fc))
38
+ * add `turbo` ([#196](https://github.com/zhangyuang/ssr/issues/196)) ([2be17bb](https://github.com/zhangyuang/ssr/commit/2be17bba5d80610b97b3813b3d4fe9579f88e5c3))
39
+ * add parseRoutes watcher when files changed remove webpack-chain in ([a499654](https://github.com/zhangyuang/ssr/commit/a49965470e2b1e1d9744b59baede586bdd5fff90))
40
+ * add ssr-common-utils ([c12a283](https://github.com/zhangyuang/ssr/commit/c12a283e0133285402f4af5cd0346b84f2aaf098))
41
+ * add ssr-serialize-javascript code optimize ([41bb14d](https://github.com/zhangyuang/ssr/commit/41bb14d31efd89d4a85d5220544d2f7a3883e1a3))
42
+ * add useStore ([b786b8c](https://github.com/zhangyuang/ssr/commit/b786b8cc314ce9d45d56ac68c93020209643b208))
43
+ * add viteConfig.ssr.external ([2035967](https://github.com/zhangyuang/ssr/commit/2035967def8d2f9d48997d6994efd8ffbb4fd382))
44
+ * babelExtraModule support vue ([06251e7](https://github.com/zhangyuang/ssr/commit/06251e716678e1f882f06f68f72c518a341de0d7))
45
+ * babelExtraModule support vue ([513073d](https://github.com/zhangyuang/ssr/commit/513073ddcecbb728d34eae233686a93d63355e00))
46
+ * change splitChunks from all to initial ([f0de225](https://github.com/zhangyuang/ssr/commit/f0de22566ff7769b02d3b7d7b75bde12a5b2c28a))
47
+ * don't cover viteConfig.build ([02aef3b](https://github.com/zhangyuang/ssr/commit/02aef3b44c1cde54d8586f0d73defdcdc7ce0ad3))
48
+ * generate html file support inject prefix ([02741ee](https://github.com/zhangyuang/ssr/commit/02741eeda778eec26504c5e7e2c074b1d2402e83))
49
+ * move react-router to external ([0a58570](https://github.com/zhangyuang/ssr/commit/0a585705fb66d9f3a4a59008f1f3e82b23f05fae))
50
+ * optimize customescript ([f374760](https://github.com/zhangyuang/ssr/commit/f3747608d4684576875968394eca6315e2fa8dd1))
51
+ * plugin-midway remove luckyeye ([bb4b11f](https://github.com/zhangyuang/ssr/commit/bb4b11f289d060c8b332cf610bb6d8c4cf25142b))
52
+ * plugin-react add react-refresh, remove module.hot ([7bee211](https://github.com/zhangyuang/ssr/commit/7bee211ddfefaef688713f505756e1155320b844))
53
+ * remove plugin-nestjs deploy ([0ba16f8](https://github.com/zhangyuang/ssr/commit/0ba16f861b6dc679f216cbbcc931de75cdf79501))
54
+ * render add generic function overloading ([f03897f](https://github.com/zhangyuang/ssr/commit/f03897f07844d8fd5f9d2cf3eeef1a726da794bf))
55
+ * set argv.ssl for plugin-midway ([#213](https://github.com/zhangyuang/ssr/issues/213)) ([65c1cb9](https://github.com/zhangyuang/ssr/commit/65c1cb9da0772e915162dcd9b03fad2fada22b40))
56
+ * support htmlTemplate ([b240811](https://github.com/zhangyuang/ssr/commit/b2408114a6314ef4f96f4c06159d18fc6d881a57))
57
+ * support props.ssrApp in vue3 ([8985037](https://github.com/zhangyuang/ssr/commit/898503753cbe69187d27f91c70dff3f4cd4a0b2a))
58
+ * support vite + wasm vite otherConfig ([7e65899](https://github.com/zhangyuang/ssr/commit/7e658998bc404c28374645c3a8a433a3db171f36))
59
+ * support vuex store options ([9bed529](https://github.com/zhangyuang/ssr/commit/9bed5299a59386e0cd70abbb8a66eca6090ed400))
60
+ * support wasm in webpack, lock postcss-preset-env version ([8ad50a4](https://github.com/zhangyuang/ssr/commit/8ad50a41227a8eb5395c955e5deeda7eb56036b0))
61
+ * support wildcare params ([c5cde18](https://github.com/zhangyuang/ssr/commit/c5cde18566365f9d3bbc81691c0ca5e7b72607d4))
62
+ * update chainBaseConfig ([51c1fbe](https://github.com/zhangyuang/ssr/commit/51c1fbe5a645d4701c7ebc035083096d50301891))
63
+ * update extraJsOrder extraCssOrder ([cd5ca99](https://github.com/zhangyuang/ssr/commit/cd5ca99a686ea565020500a6c4f77e310b422ce3))
64
+ * update fetch params ([70aedaa](https://github.com/zhangyuang/ssr/commit/70aedaa82a69552e22af1998bf1c2de8e30e0283))
65
+ * update midway deploy ([a473c59](https://github.com/zhangyuang/ssr/commit/a473c599657df42b4bf7a59f248b3c7c33907657))
66
+ * update plugin-vue3 support call pinia in fetch.ts ([958fdc7](https://github.com/zhangyuang/ssr/commit/958fdc787ab615593f3114a6bf2c6cea4823afc2))
67
+ * update ssr-common-utils ([c7cadc1](https://github.com/zhangyuang/ssr/commit/c7cadc14922383f8fdaa6c76b4dbe9c220d0ac72))
68
+ * update turbo ([9ee14f5](https://github.com/zhangyuang/ssr/commit/9ee14f59359187e35f4ef990998846ac3847347b))
69
+ * update vite config ([0596573](https://github.com/zhangyuang/ssr/commit/05965738898d96d53dedbd41746b8100dcc5653b))
70
+ * upgrade midway example to v3 ([572f7c5](https://github.com/zhangyuang/ssr/commit/572f7c5d171346cc17f5f6cdebe33aee76e0c146))
71
+ * upgrade vite@2.9.13 move ssr-hoc-react to noOptimize close [#216](https://github.com/zhangyuang/ssr/issues/216) ([842b8af](https://github.com/zhangyuang/ssr/commit/842b8af830927731a2fb35d77dde7c2a051c3670))
72
+ * upgrade vue-router^2 to vue-router^3 ([283ed9e](https://github.com/zhangyuang/ssr/commit/283ed9ec4f6d8a622bcc3599ca33f9b0885ed3e5))
73
+ * use pnpm replace yarn workspace and lerna ([#186](https://github.com/zhangyuang/ssr/issues/186)) ([d578506](https://github.com/zhangyuang/ssr/commit/d578506160712847c1dd021b7759c7e9ff3c03e8))
74
+ * use ssr-vite-plugin-style-import ([1c8cac2](https://github.com/zhangyuang/ssr/commit/1c8cac2ff9bb7ec0132c23203efa5c85a8c7492e))
75
+ * use terser minify plugin-react server bundle ([0a3c7fe](https://github.com/zhangyuang/ssr/commit/0a3c7fe61908fe24bcb2d8c6394daf2afd18ba82))
76
+ * vite build extra vendor ([#210](https://github.com/zhangyuang/ssr/issues/210)) ([3eb6e4f](https://github.com/zhangyuang/ssr/commit/3eb6e4fde592a6ef59a7fd6790b56e38c187960d))
77
+ * vite build extra vendor and client-entry ([#211](https://github.com/zhangyuang/ssr/issues/211)) ([41fb1fe](https://github.com/zhangyuang/ssr/commit/41fb1fef04a1c954828d42e4dfe40445bcea444f))
78
+ * vite mode support splitChunk dynamic module ([4157fc2](https://github.com/zhangyuang/ssr/commit/4157fc24176b69c9815450b3623742995feae144))
79
+ * vue3 add default isCustomElement ([44ab37c](https://github.com/zhangyuang/ssr/commit/44ab37c27908b5927578d78a834d2404d42c70dd))
80
+ * vue3 support pinia, replace props.fetchData to props.reactiveFetchData in vue2/3 ([eabcb50](https://github.com/zhangyuang/ssr/commit/eabcb50729517b7cb649729d52356a06a010a8fc))
81
+
82
+
83
+
84
+ ## [6.2.26](https://github.com/zhangyuang/ssr/compare/v6.2.8...v6.2.26) (2022-06-22)
85
+
86
+
87
+ ### Bug Fixes
88
+
89
+ * add build:publish disable sourcemap ([ef82b29](https://github.com/zhangyuang/ssr/commit/ef82b298ddf19b72b130d76c33bfbca67339b139))
90
+ * add prefix output to window.prefix in csr mode ([#197](https://github.com/zhangyuang/ssr/issues/197)) ([479bb3d](https://github.com/zhangyuang/ssr/commit/479bb3df67d7da5635939a4219b5f5f9a40b5508))
91
+ * build html ([83be7be](https://github.com/zhangyuang/ssr/commit/83be7be185985a5dcbb9b8e846a5e2b14b94c1b0))
92
+ * build html ([59a8d7f](https://github.com/zhangyuang/ssr/commit/59a8d7f31bed703601e753d02db49ea5a0f93054))
93
+ * ci ([57e713f](https://github.com/zhangyuang/ssr/commit/57e713f1f96b4ceb893837c15c6032b23a0b1a4c))
94
+ * core-js types ([036bf38](https://github.com/zhangyuang/ssr/commit/036bf385d8ed804dfc2e46ef4484f7bf499d7cdb))
95
+ * don't throw error when load module failed ([2e5d077](https://github.com/zhangyuang/ssr/commit/2e5d077848dc10998a04fcccccc7c745c0d1bea7))
96
+ * fix config htmlTemplate read ([#191](https://github.com/zhangyuang/ssr/issues/191)) ([8c3e12b](https://github.com/zhangyuang/ssr/commit/8c3e12b6adb64b7898bc6232d980e72c5353026b))
97
+ * loadConfig ([8960c84](https://github.com/zhangyuang/ssr/commit/8960c84eea7b384d59ebfe6424813afec433b3f8))
98
+ * lock babel-plugin-import ([72c3041](https://github.com/zhangyuang/ssr/commit/72c3041bf61a1fc9b7593df1fdb6c4dc850c6bbd))
99
+ * lock vite version in plugin-react ([e015b75](https://github.com/zhangyuang/ssr/commit/e015b750c60dcae9a4a7e5fe14937177b80367ca))
100
+ * plugin-react without dynamic mode ([487cc84](https://github.com/zhangyuang/ssr/commit/487cc84188640aab13c27214df758da0d19e4368))
101
+ * postinstall ([fef24ba](https://github.com/zhangyuang/ssr/commit/fef24bada3498f162efd0bdd09921503e44ad21a))
102
+ * postinstall get correct path ([b3d1951](https://github.com/zhangyuang/ssr/commit/b3d1951b7537c5954fd040797fc0011a1d4439d7))
103
+ * react router basename in server entry ([#212](https://github.com/zhangyuang/ssr/issues/212)) ([28072f7](https://github.com/zhangyuang/ssr/commit/28072f7bdfc489a27599b636db33bdea18ef4c18))
104
+ * Recommended to specify used minor core-js version ([#207](https://github.com/zhangyuang/ssr/issues/207)) ([9db0424](https://github.com/zhangyuang/ssr/commit/9db0424e5e7ad1728d40665d01740f7a2c1c4b70))
105
+ * restore webpack split chunks config ([2f7ae67](https://github.com/zhangyuang/ssr/commit/2f7ae67ecef863d56752a4a4e1fa7a75ec0756ed))
106
+ * revert vite build ([210ddea](https://github.com/zhangyuang/ssr/commit/210ddea22fc0639f60fcee96bdf47463d188e18f))
107
+ * update preinstall ([2b4b869](https://github.com/zhangyuang/ssr/commit/2b4b869c28b83b414bef10260e5561bc3773cea9))
108
+ * vite mode config.base ([c64aa1a](https://github.com/zhangyuang/ssr/commit/c64aa1ab9d88cdfd7df1cce6feb43b191847e666))
109
+ * **vite:** vite config base use publicPath first in client ([#192](https://github.com/zhangyuang/ssr/issues/192)) ([ef5b145](https://github.com/zhangyuang/ssr/commit/ef5b1451850441b0748727d09144e6e671f71208))
110
+ * vue3 package.json ([c49fb14](https://github.com/zhangyuang/ssr/commit/c49fb146fc6ba79ffbeee567e334b560ffecbcac))
111
+ * whitList concat userconfig ([fdd971a](https://github.com/zhangyuang/ssr/commit/fdd971ab11aebc0f348d789e758183b877e791af))
112
+ * whitList concat userconfig ([e2328f8](https://github.com/zhangyuang/ssr/commit/e2328f87f5cfc18c9a30867e4f6e18d0df5c1ba3))
113
+
114
+
115
+ ### Features
116
+
117
+ * optimize code remove disableClientRender fix vite ([eeff477](https://github.com/zhangyuang/ssr/commit/eeff4770f8d9ff400289cf4d1ca4dd32883be108))
118
+ * add .vue to defaultWhiteList ([dbabfa2](https://github.com/zhangyuang/ssr/commit/dbabfa2864ec0a5487aadc31286da5630a8603fc))
119
+ * add `turbo` ([#196](https://github.com/zhangyuang/ssr/issues/196)) ([2be17bb](https://github.com/zhangyuang/ssr/commit/2be17bba5d80610b97b3813b3d4fe9579f88e5c3))
120
+ * add parseRoutes watcher when files changed remove webpack-chain in ([a499654](https://github.com/zhangyuang/ssr/commit/a49965470e2b1e1d9744b59baede586bdd5fff90))
121
+ * add ssr-common-utils ([c12a283](https://github.com/zhangyuang/ssr/commit/c12a283e0133285402f4af5cd0346b84f2aaf098))
122
+ * add ssr-serialize-javascript code optimize ([41bb14d](https://github.com/zhangyuang/ssr/commit/41bb14d31efd89d4a85d5220544d2f7a3883e1a3))
123
+ * add viteConfig.ssr.external ([2035967](https://github.com/zhangyuang/ssr/commit/2035967def8d2f9d48997d6994efd8ffbb4fd382))
124
+ * babelExtraModule support vue ([06251e7](https://github.com/zhangyuang/ssr/commit/06251e716678e1f882f06f68f72c518a341de0d7))
125
+ * babelExtraModule support vue ([513073d](https://github.com/zhangyuang/ssr/commit/513073ddcecbb728d34eae233686a93d63355e00))
126
+ * change splitChunks from all to initial ([f0de225](https://github.com/zhangyuang/ssr/commit/f0de22566ff7769b02d3b7d7b75bde12a5b2c28a))
127
+ * optimize customescript ([f374760](https://github.com/zhangyuang/ssr/commit/f3747608d4684576875968394eca6315e2fa8dd1))
128
+ * plugin-midway remove luckyeye ([bb4b11f](https://github.com/zhangyuang/ssr/commit/bb4b11f289d060c8b332cf610bb6d8c4cf25142b))
129
+ * plugin-react add react-refresh, remove module.hot ([7bee211](https://github.com/zhangyuang/ssr/commit/7bee211ddfefaef688713f505756e1155320b844))
130
+ * remove plugin-nestjs deploy ([0ba16f8](https://github.com/zhangyuang/ssr/commit/0ba16f861b6dc679f216cbbcc931de75cdf79501))
131
+ * render add generic function overloading ([f03897f](https://github.com/zhangyuang/ssr/commit/f03897f07844d8fd5f9d2cf3eeef1a726da794bf))
132
+ * support htmlTemplate ([b240811](https://github.com/zhangyuang/ssr/commit/b2408114a6314ef4f96f4c06159d18fc6d881a57))
133
+ * support props.ssrApp in vue3 ([8985037](https://github.com/zhangyuang/ssr/commit/898503753cbe69187d27f91c70dff3f4cd4a0b2a))
134
+ * support vite + wasm vite otherConfig ([7e65899](https://github.com/zhangyuang/ssr/commit/7e658998bc404c28374645c3a8a433a3db171f36))
135
+ * support wasm in webpack, lock postcss-preset-env version ([8ad50a4](https://github.com/zhangyuang/ssr/commit/8ad50a41227a8eb5395c955e5deeda7eb56036b0))
136
+ * update chainBaseConfig ([51c1fbe](https://github.com/zhangyuang/ssr/commit/51c1fbe5a645d4701c7ebc035083096d50301891))
137
+ * update extraJsOrder extraCssOrder ([cd5ca99](https://github.com/zhangyuang/ssr/commit/cd5ca99a686ea565020500a6c4f77e310b422ce3))
138
+ * update midway deploy ([a473c59](https://github.com/zhangyuang/ssr/commit/a473c599657df42b4bf7a59f248b3c7c33907657))
139
+ * update plugin-vue3 support call pinia in fetch.ts ([958fdc7](https://github.com/zhangyuang/ssr/commit/958fdc787ab615593f3114a6bf2c6cea4823afc2))
140
+ * update ssr-common-utils ([c7cadc1](https://github.com/zhangyuang/ssr/commit/c7cadc14922383f8fdaa6c76b4dbe9c220d0ac72))
141
+ * update turbo ([9ee14f5](https://github.com/zhangyuang/ssr/commit/9ee14f59359187e35f4ef990998846ac3847347b))
142
+ * update vite config ([0596573](https://github.com/zhangyuang/ssr/commit/05965738898d96d53dedbd41746b8100dcc5653b))
143
+ * upgrade midway example to v3 ([572f7c5](https://github.com/zhangyuang/ssr/commit/572f7c5d171346cc17f5f6cdebe33aee76e0c146))
144
+ * upgrade vue-router^2 to vue-router^3 ([283ed9e](https://github.com/zhangyuang/ssr/commit/283ed9ec4f6d8a622bcc3599ca33f9b0885ed3e5))
145
+ * use pnpm replace yarn workspace and lerna ([#186](https://github.com/zhangyuang/ssr/issues/186)) ([d578506](https://github.com/zhangyuang/ssr/commit/d578506160712847c1dd021b7759c7e9ff3c03e8))
146
+ * use ssr-vite-plugin-style-import ([1c8cac2](https://github.com/zhangyuang/ssr/commit/1c8cac2ff9bb7ec0132c23203efa5c85a8c7492e))
147
+ * use terser minify plugin-react server bundle ([0a3c7fe](https://github.com/zhangyuang/ssr/commit/0a3c7fe61908fe24bcb2d8c6394daf2afd18ba82))
148
+ * vite build extra vendor ([#210](https://github.com/zhangyuang/ssr/issues/210)) ([3eb6e4f](https://github.com/zhangyuang/ssr/commit/3eb6e4fde592a6ef59a7fd6790b56e38c187960d))
149
+ * vite build extra vendor and client-entry ([#211](https://github.com/zhangyuang/ssr/issues/211)) ([41fb1fe](https://github.com/zhangyuang/ssr/commit/41fb1fef04a1c954828d42e4dfe40445bcea444f))
150
+ * vite mode support splitChunk dynamic module ([4157fc2](https://github.com/zhangyuang/ssr/commit/4157fc24176b69c9815450b3623742995feae144))
151
+ * vue3 add default isCustomElement ([44ab37c](https://github.com/zhangyuang/ssr/commit/44ab37c27908b5927578d78a834d2404d42c70dd))
152
+ * vue3 support pinia, replace props.fetchData to props.reactiveFetchData in vue2/3 ([eabcb50](https://github.com/zhangyuang/ssr/commit/eabcb50729517b7cb649729d52356a06a010a8fc))
153
+
154
+
155
+
156
+ ## [6.2.25](https://github.com/zhangyuang/ssr/compare/v6.2.8...v6.2.25) (2022-06-16)
157
+
158
+
159
+ ### Bug Fixes
160
+
161
+ * add build:publish disable sourcemap ([ef82b29](https://github.com/zhangyuang/ssr/commit/ef82b298ddf19b72b130d76c33bfbca67339b139))
162
+ * add prefix output to window.prefix in csr mode ([#197](https://github.com/zhangyuang/ssr/issues/197)) ([479bb3d](https://github.com/zhangyuang/ssr/commit/479bb3df67d7da5635939a4219b5f5f9a40b5508))
163
+ * build html ([83be7be](https://github.com/zhangyuang/ssr/commit/83be7be185985a5dcbb9b8e846a5e2b14b94c1b0))
164
+ * build html ([59a8d7f](https://github.com/zhangyuang/ssr/commit/59a8d7f31bed703601e753d02db49ea5a0f93054))
165
+ * ci ([57e713f](https://github.com/zhangyuang/ssr/commit/57e713f1f96b4ceb893837c15c6032b23a0b1a4c))
166
+ * core-js types ([036bf38](https://github.com/zhangyuang/ssr/commit/036bf385d8ed804dfc2e46ef4484f7bf499d7cdb))
167
+ * don't throw error when load module failed ([2e5d077](https://github.com/zhangyuang/ssr/commit/2e5d077848dc10998a04fcccccc7c745c0d1bea7))
168
+ * fix config htmlTemplate read ([#191](https://github.com/zhangyuang/ssr/issues/191)) ([8c3e12b](https://github.com/zhangyuang/ssr/commit/8c3e12b6adb64b7898bc6232d980e72c5353026b))
169
+ * loadConfig ([8960c84](https://github.com/zhangyuang/ssr/commit/8960c84eea7b384d59ebfe6424813afec433b3f8))
170
+ * lock babel-plugin-import ([72c3041](https://github.com/zhangyuang/ssr/commit/72c3041bf61a1fc9b7593df1fdb6c4dc850c6bbd))
171
+ * lock vite version in plugin-react ([e015b75](https://github.com/zhangyuang/ssr/commit/e015b750c60dcae9a4a7e5fe14937177b80367ca))
172
+ * plugin-react without dynamic mode ([487cc84](https://github.com/zhangyuang/ssr/commit/487cc84188640aab13c27214df758da0d19e4368))
173
+ * postinstall ([fef24ba](https://github.com/zhangyuang/ssr/commit/fef24bada3498f162efd0bdd09921503e44ad21a))
174
+ * postinstall get correct path ([b3d1951](https://github.com/zhangyuang/ssr/commit/b3d1951b7537c5954fd040797fc0011a1d4439d7))
175
+ * Recommended to specify used minor core-js version ([#207](https://github.com/zhangyuang/ssr/issues/207)) ([9db0424](https://github.com/zhangyuang/ssr/commit/9db0424e5e7ad1728d40665d01740f7a2c1c4b70))
176
+ * restore webpack split chunks config ([2f7ae67](https://github.com/zhangyuang/ssr/commit/2f7ae67ecef863d56752a4a4e1fa7a75ec0756ed))
177
+ * update preinstall ([2b4b869](https://github.com/zhangyuang/ssr/commit/2b4b869c28b83b414bef10260e5561bc3773cea9))
178
+ * vite mode config.base ([c64aa1a](https://github.com/zhangyuang/ssr/commit/c64aa1ab9d88cdfd7df1cce6feb43b191847e666))
179
+ * **vite:** vite config base use publicPath first in client ([#192](https://github.com/zhangyuang/ssr/issues/192)) ([ef5b145](https://github.com/zhangyuang/ssr/commit/ef5b1451850441b0748727d09144e6e671f71208))
180
+ * vue3 package.json ([c49fb14](https://github.com/zhangyuang/ssr/commit/c49fb146fc6ba79ffbeee567e334b560ffecbcac))
181
+ * whitList concat userconfig ([fdd971a](https://github.com/zhangyuang/ssr/commit/fdd971ab11aebc0f348d789e758183b877e791af))
182
+ * whitList concat userconfig ([e2328f8](https://github.com/zhangyuang/ssr/commit/e2328f87f5cfc18c9a30867e4f6e18d0df5c1ba3))
183
+
184
+
185
+ ### Features
186
+
187
+ * optimize code remove disableClientRender fix vite ([eeff477](https://github.com/zhangyuang/ssr/commit/eeff4770f8d9ff400289cf4d1ca4dd32883be108))
188
+ * add .vue to defaultWhiteList ([dbabfa2](https://github.com/zhangyuang/ssr/commit/dbabfa2864ec0a5487aadc31286da5630a8603fc))
189
+ * add `turbo` ([#196](https://github.com/zhangyuang/ssr/issues/196)) ([2be17bb](https://github.com/zhangyuang/ssr/commit/2be17bba5d80610b97b3813b3d4fe9579f88e5c3))
190
+ * add parseRoutes watcher when files changed remove webpack-chain in ([a499654](https://github.com/zhangyuang/ssr/commit/a49965470e2b1e1d9744b59baede586bdd5fff90))
191
+ * add ssr-common-utils ([c12a283](https://github.com/zhangyuang/ssr/commit/c12a283e0133285402f4af5cd0346b84f2aaf098))
192
+ * add ssr-serialize-javascript code optimize ([41bb14d](https://github.com/zhangyuang/ssr/commit/41bb14d31efd89d4a85d5220544d2f7a3883e1a3))
193
+ * add viteConfig.ssr.external ([2035967](https://github.com/zhangyuang/ssr/commit/2035967def8d2f9d48997d6994efd8ffbb4fd382))
194
+ * babelExtraModule support vue ([06251e7](https://github.com/zhangyuang/ssr/commit/06251e716678e1f882f06f68f72c518a341de0d7))
195
+ * babelExtraModule support vue ([513073d](https://github.com/zhangyuang/ssr/commit/513073ddcecbb728d34eae233686a93d63355e00))
196
+ * change splitChunks from all to initial ([f0de225](https://github.com/zhangyuang/ssr/commit/f0de22566ff7769b02d3b7d7b75bde12a5b2c28a))
197
+ * optimize customescript ([f374760](https://github.com/zhangyuang/ssr/commit/f3747608d4684576875968394eca6315e2fa8dd1))
198
+ * plugin-midway remove luckyeye ([bb4b11f](https://github.com/zhangyuang/ssr/commit/bb4b11f289d060c8b332cf610bb6d8c4cf25142b))
199
+ * plugin-react add react-refresh, remove module.hot ([7bee211](https://github.com/zhangyuang/ssr/commit/7bee211ddfefaef688713f505756e1155320b844))
200
+ * render add generic function overloading ([f03897f](https://github.com/zhangyuang/ssr/commit/f03897f07844d8fd5f9d2cf3eeef1a726da794bf))
201
+ * support htmlTemplate ([b240811](https://github.com/zhangyuang/ssr/commit/b2408114a6314ef4f96f4c06159d18fc6d881a57))
202
+ * support props.ssrApp in vue3 ([8985037](https://github.com/zhangyuang/ssr/commit/898503753cbe69187d27f91c70dff3f4cd4a0b2a))
203
+ * support vite + wasm vite otherConfig ([7e65899](https://github.com/zhangyuang/ssr/commit/7e658998bc404c28374645c3a8a433a3db171f36))
204
+ * support wasm in webpack, lock postcss-preset-env version ([8ad50a4](https://github.com/zhangyuang/ssr/commit/8ad50a41227a8eb5395c955e5deeda7eb56036b0))
205
+ * update chainBaseConfig ([51c1fbe](https://github.com/zhangyuang/ssr/commit/51c1fbe5a645d4701c7ebc035083096d50301891))
206
+ * update extraJsOrder extraCssOrder ([cd5ca99](https://github.com/zhangyuang/ssr/commit/cd5ca99a686ea565020500a6c4f77e310b422ce3))
207
+ * update midway deploy ([a473c59](https://github.com/zhangyuang/ssr/commit/a473c599657df42b4bf7a59f248b3c7c33907657))
208
+ * update plugin-vue3 support call pinia in fetch.ts ([958fdc7](https://github.com/zhangyuang/ssr/commit/958fdc787ab615593f3114a6bf2c6cea4823afc2))
209
+ * update ssr-common-utils ([c7cadc1](https://github.com/zhangyuang/ssr/commit/c7cadc14922383f8fdaa6c76b4dbe9c220d0ac72))
210
+ * update turbo ([9ee14f5](https://github.com/zhangyuang/ssr/commit/9ee14f59359187e35f4ef990998846ac3847347b))
211
+ * update vite config ([0596573](https://github.com/zhangyuang/ssr/commit/05965738898d96d53dedbd41746b8100dcc5653b))
212
+ * upgrade midway example to v3 ([572f7c5](https://github.com/zhangyuang/ssr/commit/572f7c5d171346cc17f5f6cdebe33aee76e0c146))
213
+ * upgrade vue-router^2 to vue-router^3 ([283ed9e](https://github.com/zhangyuang/ssr/commit/283ed9ec4f6d8a622bcc3599ca33f9b0885ed3e5))
214
+ * use pnpm replace yarn workspace and lerna ([#186](https://github.com/zhangyuang/ssr/issues/186)) ([d578506](https://github.com/zhangyuang/ssr/commit/d578506160712847c1dd021b7759c7e9ff3c03e8))
215
+ * use ssr-vite-plugin-style-import ([1c8cac2](https://github.com/zhangyuang/ssr/commit/1c8cac2ff9bb7ec0132c23203efa5c85a8c7492e))
216
+ * use terser minify plugin-react server bundle ([0a3c7fe](https://github.com/zhangyuang/ssr/commit/0a3c7fe61908fe24bcb2d8c6394daf2afd18ba82))
217
+ * vite mode support splitChunk dynamic module ([4157fc2](https://github.com/zhangyuang/ssr/commit/4157fc24176b69c9815450b3623742995feae144))
218
+ * vue3 add default isCustomElement ([44ab37c](https://github.com/zhangyuang/ssr/commit/44ab37c27908b5927578d78a834d2404d42c70dd))
219
+ * vue3 support pinia, replace props.fetchData to props.reactiveFetchData in vue2/3 ([eabcb50](https://github.com/zhangyuang/ssr/commit/eabcb50729517b7cb649729d52356a06a010a8fc))
220
+
221
+
222
+
1
223
  ## [6.2.24](https://github.com/zhangyuang/ssr/compare/v6.2.8...v6.2.24) (2022-06-13)
2
224
 
3
225
 
package/README.md CHANGED
@@ -19,12 +19,12 @@
19
19
  <a href="https://github.com/zhangyuang/ssr" target="_blank"><img src="https://img.shields.io/badge/node-%3E=12-green.svg?color=4dc71f" alt="Node" ></a>
20
20
  <a href="https://github.com/zhangyuang/ssr" target="_blank"><img src="https://img.shields.io/github/stars/zhangyuang/ssr.svg?color=4dc71f" alt="Node" ></a>
21
21
  </div>
22
- <br />
22
+ <br />
23
23
 
24
24
  `ssr` 框架是为前端框架在服务端渲染的场景下所打造的开箱即用的服务端渲染框架。了解什么是服务端渲染请查看[文档](http://doc.ssr-fc.com/docs/features$ssr)
25
25
 
26
26
  此框架脱胎于 [egg-react-ssr](https://github.com/zhangyuang/egg-react-ssr) 项目和 `ssr` v4版本`(midway-faas + react ssr)`,在之前的基础上做了诸多演进,通过插件化的代码组织形式,支持任意服务端框架与任意前端框架的组合使用。开发者可以选择通过 `Serverless` 方式部署或是以传统 `Node.js` 的应用形式部署,并且我们专注于提升 `Serverless` 场景下服务端渲染应用的开发体验,打造了一站式的开发,发布应用服务的功能。最大程度提升开发者的开发体验,将应用的开发,部署成本降到最低。
27
-
27
+
28
28
  在最新的版本中,同时支持 `React` 和 `Vue2/Vue3` 作为服务端渲染框架且开发工具侧我们同样支持了最流行的 `Vite` 来提升应用的启动速度和 HMR 速度,且提供一键以 `Serverless` 的形式发布上云的功能。我们可以非常有自信说它是地球上最先进的 `ssr` 框架。如果你希望获得开箱即用的体验且能够一键部署上云,请选择 `ssr` 框架。
29
29
 
30
30
  阅读我们的 [官方文档](http://doc.ssr-fc.com/) 获得更加详细的了解。事实上文档本身便是用 `ssr` 框架开发并通过 `Serverless` 部署到阿里云服务
@@ -88,7 +88,7 @@ const getBaseConfig = (chain, isServer) => {
88
88
  .rule('compileBabelForExtraModule')
89
89
  .test(/\.(js|mjs|jsx|ts|tsx)$/)
90
90
  .include
91
- .add([/ssr-plugin-react/, /ssr-client-utils/, /ssr-hoc-react/]);
91
+ .add([/ssr-plugin-react/, /ssr-client-utils/, /ssr-hoc-react/, /ssr-common-utils/]);
92
92
  let babelForExtraModule;
93
93
  if (babelExtraModule) {
94
94
  babelForExtraModule = module.add(babelExtraModule).end().exclude.add(/core-js/).end();
@@ -64,9 +64,9 @@ const serverRender = async (ctx, config) => {
64
64
  }
65
65
  const combineData = isCsr ? null : Object.assign(state !== null && state !== void 0 ? state : {}, layoutFetchData !== null && layoutFetchData !== void 0 ? layoutFetchData : {}, fetchData !== null && fetchData !== void 0 ? fetchData : {});
66
66
  const injectState = isCsr ? React.createElement("script", { dangerouslySetInnerHTML: { __html: `window.prefix="${prefix}"` } }) : React.createElement("script", { dangerouslySetInnerHTML: {
67
- __html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${(0, ssr_serialize_javascript_1.serialize)(combineData)}; window.prefix="${prefix}";${clientPrefix && `window.clientPrefix="${clientPrefix}"`}`
67
+ __html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${(0, ssr_serialize_javascript_1.serialize)(combineData)}; window.prefix="${prefix}";${clientPrefix ? `window.clientPrefix="${clientPrefix}";` : ''}`
68
68
  } });
69
- return (React.createElement(react_router_dom_1.StaticRouter, { location: ctx.request.url },
69
+ return (React.createElement(react_router_dom_1.StaticRouter, { location: ctx.request.url, basename: prefix },
70
70
  React.createElement(create_context_1.STORE_CONTEXT.Provider, { value: { state: combineData } },
71
71
  React.createElement(Layout, { ctx: ctx, config: config, staticList: staticList, injectState: injectState },
72
72
  React.createElement(Component, null)))));
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/tools/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAA;AAgBxC,QAAA,MAAM,YAAY,EAAE,UAwCnB,CAAA;AACD,QAAA,MAAM,YAAY,EAAE,UA+BnB,CAAA;AACD,QAAA,MAAM,SAAS,qBAEd,CAAA;AACD,QAAA,MAAM,SAAS,qBAGd,CAAA;AAED,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACb,CAAA"}
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/tools/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAA;AAgBxC,QAAA,MAAM,YAAY,EAAE,UA2CnB,CAAA;AACD,QAAA,MAAM,YAAY,EAAE,UAuCnB,CAAA;AACD,QAAA,MAAM,SAAS,qBAEd,CAAA;AACD,QAAA,MAAM,SAAS,qBAGd,CAAA;AAED,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACb,CAAA"}
package/cjs/tools/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
2
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.clientConfig = exports.serverConfig = exports.viteStart = exports.viteBuild = void 0;
5
5
  const vite_1 = require("vite");
@@ -41,9 +41,12 @@ const serverConfig = {
41
41
  (0, ssr_vite_plugin_style_import_1.createStyleImportPlugin)(styleImportConfig)
42
42
  ],
43
43
  esbuild: {
44
- keepNames: true
44
+ ...(_k = (_j = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().server) === null || _j === void 0 ? void 0 : _j.otherConfig) === null || _k === void 0 ? void 0 : _k.esbuild,
45
+ keepNames: true,
46
+ logOverride: { 'this-is-undefined-in-esm': 'silent' }
45
47
  },
46
48
  build: {
49
+ ...(_m = (_l = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().server) === null || _l === void 0 ? void 0 : _l.otherConfig) === null || _m === void 0 ? void 0 : _m.build,
47
50
  ssr: reactServerEntry,
48
51
  outDir: serverOutPut,
49
52
  rollupOptions: {
@@ -62,22 +65,30 @@ const serverConfig = {
62
65
  exports.serverConfig = serverConfig;
63
66
  const clientConfig = {
64
67
  ...(0, ssr_server_utils_1.commonConfig)(),
65
- ...(_j = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _j === void 0 ? void 0 : _j.otherConfig,
68
+ ...(_o = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _o === void 0 ? void 0 : _o.otherConfig,
66
69
  base: isDev ? '/' : (0, ssr_server_utils_1.getOutputPublicPath)(),
67
70
  esbuild: {
68
- keepNames: true
71
+ ...(_q = (_p = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _p === void 0 ? void 0 : _p.otherConfig) === null || _q === void 0 ? void 0 : _q.esbuild,
72
+ keepNames: true,
73
+ logOverride: { 'this-is-undefined-in-esm': 'silent' }
74
+ },
75
+ optimizeDeps: {
76
+ ...(_s = (_r = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _r === void 0 ? void 0 : _r.otherConfig) === null || _s === void 0 ? void 0 : _s.optimizeDeps,
77
+ include: ['react-router'].concat(...(_w = (_v = (_u = (_t = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _t === void 0 ? void 0 : _t.otherConfig) === null || _u === void 0 ? void 0 : _u.optimizeDeps) === null || _v === void 0 ? void 0 : _v.include) !== null && _w !== void 0 ? _w : []),
78
+ exclude: ['ssr-hoc-react'].concat(...(_0 = (_z = (_y = (_x = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _x === void 0 ? void 0 : _x.otherConfig) === null || _y === void 0 ? void 0 : _y.optimizeDeps) === null || _z === void 0 ? void 0 : _z.exclude) !== null && _0 !== void 0 ? _0 : [])
69
79
  },
70
80
  plugins: [
71
81
  (0, plugin_react_1.default)({
72
- ...(_l = (_k = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _k === void 0 ? void 0 : _k.client) === null || _l === void 0 ? void 0 : _l.defaultPluginOptions,
82
+ ...(_2 = (_1 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _1 === void 0 ? void 0 : _1.client) === null || _2 === void 0 ? void 0 : _2.defaultPluginOptions,
73
83
  jsxRuntime: 'classic',
74
84
  ...babelOptions
75
85
  }),
76
- (_o = (_m = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _m === void 0 ? void 0 : _m.common) === null || _o === void 0 ? void 0 : _o.extraPlugin,
77
- (_q = (_p = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _p === void 0 ? void 0 : _p.client) === null || _q === void 0 ? void 0 : _q.extraPlugin,
86
+ (_4 = (_3 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _3 === void 0 ? void 0 : _3.common) === null || _4 === void 0 ? void 0 : _4.extraPlugin,
87
+ (_6 = (_5 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _5 === void 0 ? void 0 : _5.client) === null || _6 === void 0 ? void 0 : _6.extraPlugin,
78
88
  (0, ssr_vite_plugin_style_import_1.createStyleImportPlugin)(styleImportConfig)
79
89
  ],
80
90
  build: {
91
+ ...(_8 = (_7 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _7 === void 0 ? void 0 : _7.otherConfig) === null || _8 === void 0 ? void 0 : _8.build,
81
92
  ssrManifest: true,
82
93
  outDir: clientOutPut,
83
94
  rollupOptions: {
@@ -85,7 +85,7 @@ const getBaseConfig = (chain, isServer) => {
85
85
  .rule('compileBabelForExtraModule')
86
86
  .test(/\.(js|mjs|jsx|ts|tsx)$/)
87
87
  .include
88
- .add([/ssr-plugin-react/, /ssr-client-utils/, /ssr-hoc-react/]);
88
+ .add([/ssr-plugin-react/, /ssr-client-utils/, /ssr-hoc-react/, /ssr-common-utils/]);
89
89
  let babelForExtraModule;
90
90
  if (babelExtraModule) {
91
91
  babelForExtraModule = module.add(babelExtraModule).end().exclude.add(/core-js/).end();
@@ -61,9 +61,9 @@ const serverRender = async (ctx, config) => {
61
61
  }
62
62
  const combineData = isCsr ? null : Object.assign(state !== null && state !== void 0 ? state : {}, layoutFetchData !== null && layoutFetchData !== void 0 ? layoutFetchData : {}, fetchData !== null && fetchData !== void 0 ? fetchData : {});
63
63
  const injectState = isCsr ? React.createElement("script", { dangerouslySetInnerHTML: { __html: `window.prefix="${prefix}"` } }) : React.createElement("script", { dangerouslySetInnerHTML: {
64
- __html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${serialize(combineData)}; window.prefix="${prefix}";${clientPrefix && `window.clientPrefix="${clientPrefix}"`}`
64
+ __html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${serialize(combineData)}; window.prefix="${prefix}";${clientPrefix ? `window.clientPrefix="${clientPrefix}";` : ''}`
65
65
  } });
66
- return (React.createElement(StaticRouter, { location: ctx.request.url },
66
+ return (React.createElement(StaticRouter, { location: ctx.request.url, basename: prefix },
67
67
  React.createElement(Context.Provider, { value: { state: combineData } },
68
68
  React.createElement(Layout, { ctx: ctx, config: config, staticList: staticList, injectState: injectState },
69
69
  React.createElement(Component, null)))));
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/tools/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAA;AAgBxC,QAAA,MAAM,YAAY,EAAE,UAwCnB,CAAA;AACD,QAAA,MAAM,YAAY,EAAE,UA+BnB,CAAA;AACD,QAAA,MAAM,SAAS,qBAEd,CAAA;AACD,QAAA,MAAM,SAAS,qBAGd,CAAA;AAED,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACb,CAAA"}
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/tools/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,MAAM,CAAA;AAgBxC,QAAA,MAAM,YAAY,EAAE,UA2CnB,CAAA;AACD,QAAA,MAAM,YAAY,EAAE,UAuCnB,CAAA;AACD,QAAA,MAAM,SAAS,qBAEd,CAAA;AACD,QAAA,MAAM,SAAS,qBAGd,CAAA;AAED,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,YAAY,EACb,CAAA"}
package/esm/tools/vite.js CHANGED
@@ -1,4 +1,4 @@
1
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
2
2
  import { build } from 'vite';
3
3
  import { loadConfig, chunkNamePlugin, rollupOutputOptions, manifestPlugin, commonConfig, asyncOptimizeChunkPlugin, getOutputPublicPath } from 'ssr-server-utils';
4
4
  import react from '@vitejs/plugin-react';
@@ -38,9 +38,12 @@ const serverConfig = {
38
38
  createStyleImportPlugin(styleImportConfig)
39
39
  ],
40
40
  esbuild: {
41
- keepNames: true
41
+ ...(_k = (_j = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().server) === null || _j === void 0 ? void 0 : _j.otherConfig) === null || _k === void 0 ? void 0 : _k.esbuild,
42
+ keepNames: true,
43
+ logOverride: { 'this-is-undefined-in-esm': 'silent' }
42
44
  },
43
45
  build: {
46
+ ...(_m = (_l = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().server) === null || _l === void 0 ? void 0 : _l.otherConfig) === null || _m === void 0 ? void 0 : _m.build,
44
47
  ssr: reactServerEntry,
45
48
  outDir: serverOutPut,
46
49
  rollupOptions: {
@@ -58,22 +61,30 @@ const serverConfig = {
58
61
  };
59
62
  const clientConfig = {
60
63
  ...commonConfig(),
61
- ...(_j = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _j === void 0 ? void 0 : _j.otherConfig,
64
+ ...(_o = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _o === void 0 ? void 0 : _o.otherConfig,
62
65
  base: isDev ? '/' : getOutputPublicPath(),
63
66
  esbuild: {
64
- keepNames: true
67
+ ...(_q = (_p = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _p === void 0 ? void 0 : _p.otherConfig) === null || _q === void 0 ? void 0 : _q.esbuild,
68
+ keepNames: true,
69
+ logOverride: { 'this-is-undefined-in-esm': 'silent' }
70
+ },
71
+ optimizeDeps: {
72
+ ...(_s = (_r = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _r === void 0 ? void 0 : _r.otherConfig) === null || _s === void 0 ? void 0 : _s.optimizeDeps,
73
+ include: ['react-router'].concat(...(_w = (_v = (_u = (_t = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _t === void 0 ? void 0 : _t.otherConfig) === null || _u === void 0 ? void 0 : _u.optimizeDeps) === null || _v === void 0 ? void 0 : _v.include) !== null && _w !== void 0 ? _w : []),
74
+ exclude: ['ssr-hoc-react'].concat(...(_0 = (_z = (_y = (_x = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _x === void 0 ? void 0 : _x.otherConfig) === null || _y === void 0 ? void 0 : _y.optimizeDeps) === null || _z === void 0 ? void 0 : _z.exclude) !== null && _0 !== void 0 ? _0 : [])
65
75
  },
66
76
  plugins: [
67
77
  react({
68
- ...(_l = (_k = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _k === void 0 ? void 0 : _k.client) === null || _l === void 0 ? void 0 : _l.defaultPluginOptions,
78
+ ...(_2 = (_1 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _1 === void 0 ? void 0 : _1.client) === null || _2 === void 0 ? void 0 : _2.defaultPluginOptions,
69
79
  jsxRuntime: 'classic',
70
80
  ...babelOptions
71
81
  }),
72
- (_o = (_m = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _m === void 0 ? void 0 : _m.common) === null || _o === void 0 ? void 0 : _o.extraPlugin,
73
- (_q = (_p = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _p === void 0 ? void 0 : _p.client) === null || _q === void 0 ? void 0 : _q.extraPlugin,
82
+ (_4 = (_3 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _3 === void 0 ? void 0 : _3.common) === null || _4 === void 0 ? void 0 : _4.extraPlugin,
83
+ (_6 = (_5 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _5 === void 0 ? void 0 : _5.client) === null || _6 === void 0 ? void 0 : _6.extraPlugin,
74
84
  createStyleImportPlugin(styleImportConfig)
75
85
  ],
76
86
  build: {
87
+ ...(_8 = (_7 = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig().client) === null || _7 === void 0 ? void 0 : _7.otherConfig) === null || _8 === void 0 ? void 0 : _8.build,
77
88
  ssrManifest: true,
78
89
  outDir: clientOutPut,
79
90
  rollupOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssr-plugin-react",
3
- "version": "6.2.24",
3
+ "version": "6.2.27",
4
4
  "description": "plugin-react for ssr",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -59,15 +59,15 @@
59
59
  "react-refresh": "^0.12.0",
60
60
  "react-router": "^5.2.1",
61
61
  "react-router-dom": "^5.1.2",
62
- "ssr-serialize-javascript": "^6.0.0",
63
62
  "ssr-client-utils": "^6.2.7",
64
63
  "ssr-hoc-react": "^6.2.7",
64
+ "ssr-serialize-javascript": "^6.0.0",
65
65
  "ssr-server-utils": "^6.2.10",
66
+ "ssr-vite-plugin-style-import": "^2.0.0",
66
67
  "ssr-webpack": "^6.2.10",
67
68
  "terser-webpack-plugin": "^2.3.5",
68
69
  "url-loader": "^4.1.1",
69
- "vite": "2.7.0",
70
- "ssr-vite-plugin-style-import": "^2.0.0",
70
+ "vite": "^2.9.13",
71
71
  "webpack": "^4.42.1",
72
72
  "webpack-bundle-analyzer": "^3.6.1",
73
73
  "webpack-chain": "^6.4.0",
@@ -95,7 +95,7 @@ const getBaseConfig = (chain: WebpackChain, isServer: boolean) => {
95
95
  .rule('compileBabelForExtraModule')
96
96
  .test(/\.(js|mjs|jsx|ts|tsx)$/)
97
97
  .include
98
- .add([/ssr-plugin-react/, /ssr-client-utils/, /ssr-hoc-react/])
98
+ .add([/ssr-plugin-react/, /ssr-client-utils/, /ssr-hoc-react/, /ssr-common-utils/])
99
99
 
100
100
  let babelForExtraModule
101
101
  if (babelExtraModule) {
@@ -69,11 +69,11 @@ const serverRender = async (ctx: ISSRContext, config: IConfig): Promise<React.Re
69
69
  }
70
70
  const combineData = isCsr ? null : Object.assign(state ?? {}, layoutFetchData ?? {}, fetchData ?? {})
71
71
  const injectState = isCsr ? <script dangerouslySetInnerHTML={{ __html: `window.prefix="${prefix}"` }} /> : <script dangerouslySetInnerHTML={{
72
- __html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${serialize(combineData)}; window.prefix="${prefix}";${clientPrefix && `window.clientPrefix="${clientPrefix}"`}`
72
+ __html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${serialize(combineData)}; window.prefix="${prefix}";${clientPrefix ? `window.clientPrefix="${clientPrefix}";` : ''}`
73
73
  }} />
74
74
 
75
75
  return (
76
- <StaticRouter location={ctx.request.url}>
76
+ <StaticRouter location={ctx.request.url} basename={prefix}>
77
77
  <Context.Provider value={{ state: combineData }}>
78
78
  <Layout ctx={ctx} config={config} staticList={staticList} injectState={injectState}>
79
79
  <Component />
package/src/tools/vite.ts CHANGED
@@ -37,9 +37,12 @@ const serverConfig: UserConfig = {
37
37
  createStyleImportPlugin(styleImportConfig)
38
38
  ],
39
39
  esbuild: {
40
- keepNames: true
40
+ ...viteConfig?.().server?.otherConfig?.esbuild,
41
+ keepNames: true,
42
+ logOverride: { 'this-is-undefined-in-esm': 'silent' }
41
43
  },
42
44
  build: {
45
+ ...viteConfig?.().server?.otherConfig?.build,
43
46
  ssr: reactServerEntry,
44
47
  outDir: serverOutPut,
45
48
  rollupOptions: {
@@ -60,7 +63,14 @@ const clientConfig: UserConfig = {
60
63
  ...viteConfig?.().client?.otherConfig,
61
64
  base: isDev ? '/' : getOutputPublicPath(),
62
65
  esbuild: {
63
- keepNames: true
66
+ ...viteConfig?.().client?.otherConfig?.esbuild,
67
+ keepNames: true,
68
+ logOverride: { 'this-is-undefined-in-esm': 'silent' }
69
+ },
70
+ optimizeDeps: {
71
+ ...viteConfig?.().client?.otherConfig?.optimizeDeps,
72
+ include: ['react-router'].concat(...viteConfig?.().client?.otherConfig?.optimizeDeps?.include ?? []),
73
+ exclude: ['ssr-hoc-react'].concat(...viteConfig?.().client?.otherConfig?.optimizeDeps?.exclude ?? [])
64
74
  },
65
75
  plugins: [
66
76
  react({
@@ -73,6 +83,7 @@ const clientConfig: UserConfig = {
73
83
  createStyleImportPlugin(styleImportConfig)
74
84
  ],
75
85
  build: {
86
+ ...viteConfig?.().client?.otherConfig?.build,
76
87
  ssrManifest: true,
77
88
  outDir: clientOutPut,
78
89
  rollupOptions: {