@teambit/react 0.0.1052 → 0.0.1053
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/apps/web/react-app-options.ts +10 -0
- package/apps/web/react.app-type.ts +3 -1
- package/apps/web/react.application.ts +21 -12
- package/artifacts/env-template/public/{333.f1ec0ca32e6451d0fd68.js → 624.339523ffa2713fab9603.js} +2 -2
- package/artifacts/env-template/public/assets-manifest.json +10 -10
- package/artifacts/env-template/public/{compositions.34b44c6a235f2636429c.js → compositions.4b3e01aed63b1c37c994.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.bde794cf1a7153a84e26.js → overview.35b05f6ec2e554b6f143.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.b0120675504cc9f94beb.js → peers.6c2c2c538bcb0e2f6b7a.js} +1 -1
- package/artifacts/env-template/public/{preview-root.c6a9d6c7a88f9849d607.js → preview-root.2fd58ef41e0ab690a97f.js} +1 -1
- package/dist/apps/web/react-app-options.d.ts +8 -0
- package/dist/apps/web/react-app-options.js.map +1 -1
- package/dist/apps/web/react.app-type.js +1 -1
- package/dist/apps/web/react.app-type.js.map +1 -1
- package/dist/apps/web/react.application.d.ts +3 -1
- package/dist/apps/web/react.application.js +8 -6
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/{preview-1683689530779.js → preview-1683776045298.js} +2 -2
- package/dist/react.env.d.ts +4 -4
- package/dist/react.env.js +10 -10
- package/dist/react.env.js.map +1 -1
- package/dist/react.main.runtime.d.ts +2 -0
- package/dist/react.main.runtime.js +4 -4
- package/dist/react.main.runtime.js.map +1 -1
- package/package-tar/teambit-react-0.0.1053.tgz +0 -0
- package/package.json +31 -31
- package/package-tar/teambit-react-0.0.1052.tgz +0 -0
- /package/{compositions-1683689530779.js → compositions-1683776045298.js} +0 -0
- /package/{overview-1683689530779.js → overview-1683776045298.js} +0 -0
|
@@ -65,4 +65,14 @@ export type ReactAppOptions = {
|
|
|
65
65
|
* favicon for the app. You can pass an abs path (using require.resolve()) or a url.
|
|
66
66
|
*/
|
|
67
67
|
favicon?: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* path to load the webpack instance from
|
|
71
|
+
*/
|
|
72
|
+
webpackModulePath?: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* path to load the webpack dev server instance from.
|
|
76
|
+
*/
|
|
77
|
+
webpackDevServerModulePath?: string;
|
|
68
78
|
};
|
|
@@ -28,7 +28,9 @@ export class ReactAppType implements ApplicationType<ReactAppOptions> {
|
|
|
28
28
|
options.devServer,
|
|
29
29
|
options.webpackTransformers,
|
|
30
30
|
options.deploy,
|
|
31
|
-
options.favicon
|
|
31
|
+
options.favicon,
|
|
32
|
+
options.webpackModulePath,
|
|
33
|
+
options.webpackDevServerModulePath
|
|
32
34
|
);
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -35,7 +35,9 @@ export class ReactApp implements Application {
|
|
|
35
35
|
readonly devServer?: DevServer,
|
|
36
36
|
readonly transformers: WebpackConfigTransformer[] = [],
|
|
37
37
|
readonly deploy?: (context: ReactDeployContext) => Promise<void>,
|
|
38
|
-
readonly favicon?: string
|
|
38
|
+
readonly favicon?: string,
|
|
39
|
+
readonly webpackModulePath?: string,
|
|
40
|
+
readonly webpackDevServerModulePath?: string
|
|
39
41
|
) {}
|
|
40
42
|
readonly applicationType = 'react-common-js';
|
|
41
43
|
readonly dir = 'public';
|
|
@@ -51,7 +53,12 @@ export class ReactApp implements Application {
|
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
const devServerContext = await this.getDevServerContext(context);
|
|
54
|
-
const devServer = this.reactEnv.getDevServer(
|
|
56
|
+
const devServer = this.reactEnv.getDevServer(
|
|
57
|
+
devServerContext,
|
|
58
|
+
[addDevServer, setOutput, ...this.transformers],
|
|
59
|
+
this.webpackModulePath,
|
|
60
|
+
this.webpackDevServerModulePath
|
|
61
|
+
);
|
|
55
62
|
await devServer.listen(port);
|
|
56
63
|
return port;
|
|
57
64
|
}
|
|
@@ -115,10 +122,11 @@ export class ReactApp implements Application {
|
|
|
115
122
|
previousTasksResults: [],
|
|
116
123
|
});
|
|
117
124
|
|
|
118
|
-
const bundler = await this.reactEnv.getBundler(
|
|
119
|
-
|
|
120
|
-
...this.transformers,
|
|
121
|
-
|
|
125
|
+
const bundler = await this.reactEnv.getBundler(
|
|
126
|
+
ctx,
|
|
127
|
+
[(config) => config.merge([clientConfig()]), ...this.transformers],
|
|
128
|
+
this.webpackModulePath
|
|
129
|
+
);
|
|
122
130
|
|
|
123
131
|
const bundleResult = await bundler.run();
|
|
124
132
|
return bundleResult[0];
|
|
@@ -143,10 +151,11 @@ export class ReactApp implements Application {
|
|
|
143
151
|
previousTasksResults: [],
|
|
144
152
|
});
|
|
145
153
|
|
|
146
|
-
const bundler = await this.reactEnv.getBundler(
|
|
147
|
-
|
|
148
|
-
...this.transformers,
|
|
149
|
-
|
|
154
|
+
const bundler = await this.reactEnv.getBundler(
|
|
155
|
+
ctx,
|
|
156
|
+
[(config) => config.merge([ssrConfig()]), ...this.transformers],
|
|
157
|
+
this.webpackModulePath
|
|
158
|
+
);
|
|
150
159
|
|
|
151
160
|
const bundleResult = await bundler.run();
|
|
152
161
|
return bundleResult[0];
|
|
@@ -246,7 +255,7 @@ export class ReactApp implements Application {
|
|
|
246
255
|
]);
|
|
247
256
|
|
|
248
257
|
const reactEnv = context.env as ReactEnv;
|
|
249
|
-
const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers);
|
|
258
|
+
const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers, this.webpackModulePath);
|
|
250
259
|
return bundler;
|
|
251
260
|
}
|
|
252
261
|
|
|
@@ -263,7 +272,7 @@ export class ReactApp implements Application {
|
|
|
263
272
|
]);
|
|
264
273
|
|
|
265
274
|
const reactEnv = context.env as ReactEnv;
|
|
266
|
-
const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers);
|
|
275
|
+
const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers, this.webpackModulePath);
|
|
267
276
|
return bundler;
|
|
268
277
|
}
|
|
269
278
|
|