@teambit/react 0.0.692 → 0.0.693
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.application.ts +17 -0
- package/artifacts/env-template/public/283.js +34 -1
- package/artifacts/env-template/public/420.js +74 -1
- package/artifacts/env-template/public/677.js +4 -1
- package/artifacts/env-template/public/750.js +86 -2
- package/artifacts/env-template/public/793.js +744 -16
- package/artifacts/env-template/public/934.js +30 -1
- package/artifacts/env-template/public/assets-manifest.json +8 -8
- package/artifacts/env-template/public/compositions.54cedf393c7a2f90de37.js +1 -0
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/overview.285734acef6c338b6d42.js +5 -0
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/peers.b1e5a815a97146071b4a.js +1 -0
- package/artifacts/env-template/public/preview-root.406bbcb02c30b45c68e6.js +1 -0
- package/artifacts/env-template/public/runtime.js +1 -1
- package/artifacts/env-template/public/service-worker.js +1 -1
- package/artifacts/preview/teambit_react_react-preview.js +11 -1
- package/{compositions-1648437892896.js → compositions-1648524148272.js} +0 -0
- package/dist/apps/web/react.application.js +39 -0
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/webpack/webpack.config.base.prod.js +52 -37
- package/dist/webpack/webpack.config.base.prod.js.map +1 -1
- package/{overview-1648437892896.js → overview-1648524148272.js} +0 -0
- package/package-tar/teambit-react-0.0.693.tgz +0 -0
- package/package.json +27 -25
- package/{preview-1648437892896.js → preview-1648524148272.js} +2 -2
- package/webpack/webpack.config.base.prod.ts +50 -34
- package/artifacts/env-template/public/compositions.5509b866f86976c8234c.js +0 -1
- package/artifacts/env-template/public/overview.43a93c2f24a229ed579c.js +0 -1
- package/artifacts/env-template/public/peers.f0c76108cfe204de95bd.js +0 -1
- package/artifacts/env-template/public/preview-root.a1f71de58f10102ed2c6.js +0 -1
- package/package-tar/teambit-react-0.0.692.tgz +0 -0
|
@@ -2,6 +2,8 @@ import { join, basename } from 'path';
|
|
|
2
2
|
import { Application, AppContext, AppBuildContext } from '@teambit/application';
|
|
3
3
|
import { Bundler, DevServer, BundlerContext, DevServerContext, BundlerHtmlConfig } from '@teambit/bundler';
|
|
4
4
|
import { Port } from '@teambit/toolbox.network.get-port';
|
|
5
|
+
import { remove } from 'lodash';
|
|
6
|
+
import TerserPlugin from 'terser-webpack-plugin';
|
|
5
7
|
import { WebpackConfigTransformer } from '@teambit/webpack';
|
|
6
8
|
import { ReactEnv } from '../../react.env';
|
|
7
9
|
import { prerenderSPAPlugin } from './plugins';
|
|
@@ -101,6 +103,21 @@ export class ReactApp implements Application {
|
|
|
101
103
|
const defaultTransformer: WebpackConfigTransformer = (configMutator) => {
|
|
102
104
|
const config = configMutator.addTopLevel('output', { path: staticDir, publicPath: `/` });
|
|
103
105
|
if (this.prerenderRoutes) config.addPlugin(prerenderSPAPlugin(this.prerenderRoutes, staticDir));
|
|
106
|
+
if (config.raw.optimization?.minimizer) {
|
|
107
|
+
remove(config.raw.optimization?.minimizer, (minimizer) => {
|
|
108
|
+
return minimizer.constructor.name === 'TerserPlugin';
|
|
109
|
+
});
|
|
110
|
+
config.raw.optimization?.minimizer.push(
|
|
111
|
+
new TerserPlugin({
|
|
112
|
+
minify: TerserPlugin.esbuildMinify,
|
|
113
|
+
// `terserOptions` options will be passed to `esbuild`
|
|
114
|
+
// Link to options - https://esbuild.github.io/api/#minify
|
|
115
|
+
terserOptions: {
|
|
116
|
+
minify: true,
|
|
117
|
+
},
|
|
118
|
+
})
|
|
119
|
+
);
|
|
120
|
+
}
|
|
104
121
|
return config;
|
|
105
122
|
};
|
|
106
123
|
const transformers = [defaultTransformer, ...(this.transformers ?? [])];
|