wgt-node-utils 0.0.16 → 0.0.17
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/dist/bundle.js +1 -1
- package/package.json +1 -1
- package/src/index.js +6 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -247,8 +247,9 @@ class wgtNodeUtils {
|
|
|
247
247
|
* @buildName 打包名称
|
|
248
248
|
* @version 打包版本号
|
|
249
249
|
* @dirname 项目的绝对地址
|
|
250
|
+
* @useReactRouterDom 是否需要reactRouterDom
|
|
250
251
|
*/
|
|
251
|
-
readF2eFiles = (buildName, version, dirname) => {
|
|
252
|
+
readF2eFiles = (buildName, version, dirname, useReactRouterDom) => {
|
|
252
253
|
console.log('静态资源:开始读取');
|
|
253
254
|
return new Promise((resolve, reject) => {
|
|
254
255
|
try {
|
|
@@ -272,7 +273,10 @@ class wgtNodeUtils {
|
|
|
272
273
|
// 增加react依赖
|
|
273
274
|
this.fileContents['react.production.min.js'] = fs.readFileSync(path.join(dirname, `../${buildName}/dist/react.production.min.js`),'utf8');
|
|
274
275
|
this.fileContents['react-dom.production.min.js'] = fs.readFileSync(path.join(dirname, `../${buildName}/dist/react-dom.production.min.js`),'utf8');
|
|
275
|
-
|
|
276
|
+
|
|
277
|
+
if (useReactRouterDom) {
|
|
278
|
+
this.fileContents['react-router-dom.min.js'] = fs.readFileSync(path.join(dirname, `../${buildName}/dist/react-router-dom.min.js`),'utf8');
|
|
279
|
+
}
|
|
276
280
|
|
|
277
281
|
console.log('静态资源列表:');
|
|
278
282
|
const f2eFileLoadStatus = Object.keys(this.fileContents).every((item) => {
|