@teambit/react 0.0.690 → 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-app-options.ts +5 -0
- package/apps/web/react.app-type.ts +2 -1
- package/apps/web/react.application.ts +21 -2
- 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 +10 -10
- 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/env-template/public/static/css/{793.539a9611.css → 793.253dc893.css} +1 -1
- package/artifacts/preview/teambit_react_react-preview.js +11 -1
- package/{compositions-1648265027481.js → compositions-1648524148272.js} +0 -0
- package/dist/apps/web/react-app-options.d.ts +4 -0
- 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 +2 -1
- package/dist/apps/web/react.application.js +45 -3
- 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-1648265027481.js → overview-1648524148272.js} +0 -0
- package/package-tar/teambit-react-0.0.693.tgz +0 -0
- package/package.json +29 -27
- package/{preview-1648265027481.js → preview-1648524148272.js} +2 -2
- package/webpack/webpack.config.base.prod.ts +50 -34
- package/artifacts/env-template/public/compositions.e8531c3d51e6aac51919.js +0 -1
- package/artifacts/env-template/public/overview.43931650ae35d40d2453.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.690.tgz +0 -0
|
File without changes
|
|
@@ -24,7 +24,7 @@ class ReactAppType {
|
|
|
24
24
|
createApp(options) {
|
|
25
25
|
var _options$prerender;
|
|
26
26
|
|
|
27
|
-
return new (_react().ReactApp)(options.name, options.entry, options.portRange || [3000, 4000], this.reactEnv, (_options$prerender = options.prerender) === null || _options$prerender === void 0 ? void 0 : _options$prerender.routes, options.bundler, options.devServer, options.webpackTransformers, options.deploy);
|
|
27
|
+
return new (_react().ReactApp)(options.name, options.entry, options.portRange || [3000, 4000], this.reactEnv, (_options$prerender = options.prerender) === null || _options$prerender === void 0 ? void 0 : _options$prerender.routes, options.bundler, options.devServer, options.webpackTransformers, options.deploy, options.favicon);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["react.app-type.ts"],"names":["ReactAppType","constructor","name","reactEnv","createApp","options","ReactApp","entry","portRange","prerender","routes","bundler","devServer","webpackTransformers","deploy"],"mappings":";;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,YAAN,CAA+D;AACpEC,EAAAA,WAAW,CAAUC,IAAV,EAAgCC,QAAhC,EAAoD;AAAA,SAA1CD,IAA0C,GAA1CA,IAA0C;AAAA,SAApBC,QAAoB,GAApBA,QAAoB;AAAE;;AAEjEC,EAAAA,SAAS,CAACC,OAAD,EAA2B;AAAA;;AAClC,WAAO,KAAIC,iBAAJ,EACLD,OAAO,CAACH,IADH,EAELG,OAAO,CAACE,KAFH,EAGLF,OAAO,CAACG,SAAR,IAAqB,CAAC,IAAD,EAAO,IAAP,CAHhB,EAIL,KAAKL,QAJA,wBAKLE,OAAO,CAACI,SALH,uDAKL,mBAAmBC,MALd,EAMLL,OAAO,CAACM,OANH,EAOLN,OAAO,CAACO,SAPH,EAQLP,OAAO,CAACQ,mBARH,EASLR,OAAO,CAACS,MATH,CAAP;
|
|
1
|
+
{"version":3,"sources":["react.app-type.ts"],"names":["ReactAppType","constructor","name","reactEnv","createApp","options","ReactApp","entry","portRange","prerender","routes","bundler","devServer","webpackTransformers","deploy","favicon"],"mappings":";;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,YAAN,CAA+D;AACpEC,EAAAA,WAAW,CAAUC,IAAV,EAAgCC,QAAhC,EAAoD;AAAA,SAA1CD,IAA0C,GAA1CA,IAA0C;AAAA,SAApBC,QAAoB,GAApBA,QAAoB;AAAE;;AAEjEC,EAAAA,SAAS,CAACC,OAAD,EAA2B;AAAA;;AAClC,WAAO,KAAIC,iBAAJ,EACLD,OAAO,CAACH,IADH,EAELG,OAAO,CAACE,KAFH,EAGLF,OAAO,CAACG,SAAR,IAAqB,CAAC,IAAD,EAAO,IAAP,CAHhB,EAIL,KAAKL,QAJA,wBAKLE,OAAO,CAACI,SALH,uDAKL,mBAAmBC,MALd,EAMLL,OAAO,CAACM,OANH,EAOLN,OAAO,CAACO,SAPH,EAQLP,OAAO,CAACQ,mBARH,EASLR,OAAO,CAACS,MATH,EAULT,OAAO,CAACU,OAVH,CAAP;AAYD;;AAhBmE","sourcesContent":["import { ApplicationType } from '@teambit/application';\nimport { ReactAppOptions } from './react-app-options';\nimport { ReactApp } from './react.application';\nimport { ReactEnv } from '../../react.env';\n\nexport class ReactAppType implements ApplicationType<ReactAppOptions> {\n constructor(readonly name: string, private reactEnv: ReactEnv) {}\n\n createApp(options: ReactAppOptions) {\n return new ReactApp(\n options.name,\n options.entry,\n options.portRange || [3000, 4000],\n this.reactEnv,\n options.prerender?.routes,\n options.bundler,\n options.devServer,\n options.webpackTransformers,\n options.deploy,\n options.favicon\n );\n }\n}\n"]}
|
|
@@ -14,7 +14,8 @@ export declare class ReactApp implements Application {
|
|
|
14
14
|
readonly devServer?: DevServer | undefined;
|
|
15
15
|
readonly transformers?: WebpackConfigTransformer[] | undefined;
|
|
16
16
|
readonly deploy?: ((context: ReactDeployContext) => Promise<void>) | undefined;
|
|
17
|
-
|
|
17
|
+
readonly favicon?: string | undefined;
|
|
18
|
+
constructor(name: string, entry: string[], portRange: number[], reactEnv: ReactEnv, prerenderRoutes?: string[] | undefined, bundler?: Bundler | undefined, devServer?: DevServer | undefined, transformers?: WebpackConfigTransformer[] | undefined, deploy?: ((context: ReactDeployContext) => Promise<void>) | undefined, favicon?: string | undefined);
|
|
18
19
|
readonly applicationType = "react-common-js";
|
|
19
20
|
readonly dir = "public";
|
|
20
21
|
run(context: AppContext): Promise<number>;
|
|
@@ -41,6 +41,26 @@ function _toolboxNetwork() {
|
|
|
41
41
|
return data;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
function _lodash() {
|
|
45
|
+
const data = require("lodash");
|
|
46
|
+
|
|
47
|
+
_lodash = function () {
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _terserWebpackPlugin() {
|
|
55
|
+
const data = _interopRequireDefault(require("terser-webpack-plugin"));
|
|
56
|
+
|
|
57
|
+
_terserWebpackPlugin = function () {
|
|
58
|
+
return data;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
function _plugins() {
|
|
45
65
|
const data = require("./plugins");
|
|
46
66
|
|
|
@@ -62,7 +82,7 @@ function _webpack() {
|
|
|
62
82
|
}
|
|
63
83
|
|
|
64
84
|
class ReactApp {
|
|
65
|
-
constructor(name, entry, portRange, reactEnv, prerenderRoutes, bundler, devServer, transformers, deploy) {
|
|
85
|
+
constructor(name, entry, portRange, reactEnv, prerenderRoutes, bundler, devServer, transformers, deploy, favicon) {
|
|
66
86
|
this.name = name;
|
|
67
87
|
this.entry = entry;
|
|
68
88
|
this.portRange = portRange;
|
|
@@ -72,6 +92,7 @@ class ReactApp {
|
|
|
72
92
|
this.devServer = devServer;
|
|
73
93
|
this.transformers = transformers;
|
|
74
94
|
this.deploy = deploy;
|
|
95
|
+
this.favicon = favicon;
|
|
75
96
|
(0, _defineProperty2().default)(this, "applicationType", 'react-common-js');
|
|
76
97
|
(0, _defineProperty2().default)(this, "dir", 'public');
|
|
77
98
|
}
|
|
@@ -105,7 +126,8 @@ class ReactApp {
|
|
|
105
126
|
const htmlConfig = [{
|
|
106
127
|
title: context.name,
|
|
107
128
|
templateContent: (0, _webpack().html)(context.name),
|
|
108
|
-
minify: false
|
|
129
|
+
minify: false,
|
|
130
|
+
favicon: this.favicon // filename: ''.html`,
|
|
109
131
|
|
|
110
132
|
}];
|
|
111
133
|
Object.assign(context, {
|
|
@@ -152,11 +174,30 @@ class ReactApp {
|
|
|
152
174
|
});
|
|
153
175
|
|
|
154
176
|
const defaultTransformer = configMutator => {
|
|
177
|
+
var _config$raw$optimizat;
|
|
178
|
+
|
|
155
179
|
const config = configMutator.addTopLevel('output', {
|
|
156
180
|
path: staticDir,
|
|
157
181
|
publicPath: `/`
|
|
158
182
|
});
|
|
159
183
|
if (this.prerenderRoutes) config.addPlugin((0, _plugins().prerenderSPAPlugin)(this.prerenderRoutes, staticDir));
|
|
184
|
+
|
|
185
|
+
if ((_config$raw$optimizat = config.raw.optimization) !== null && _config$raw$optimizat !== void 0 && _config$raw$optimizat.minimizer) {
|
|
186
|
+
var _config$raw$optimizat2, _config$raw$optimizat3;
|
|
187
|
+
|
|
188
|
+
(0, _lodash().remove)((_config$raw$optimizat2 = config.raw.optimization) === null || _config$raw$optimizat2 === void 0 ? void 0 : _config$raw$optimizat2.minimizer, minimizer => {
|
|
189
|
+
return minimizer.constructor.name === 'TerserPlugin';
|
|
190
|
+
});
|
|
191
|
+
(_config$raw$optimizat3 = config.raw.optimization) === null || _config$raw$optimizat3 === void 0 ? void 0 : _config$raw$optimizat3.minimizer.push(new (_terserWebpackPlugin().default)({
|
|
192
|
+
minify: _terserWebpackPlugin().default.esbuildMinify,
|
|
193
|
+
// `terserOptions` options will be passed to `esbuild`
|
|
194
|
+
// Link to options - https://esbuild.github.io/api/#minify
|
|
195
|
+
terserOptions: {
|
|
196
|
+
minify: true
|
|
197
|
+
}
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
|
|
160
201
|
return config;
|
|
161
202
|
};
|
|
162
203
|
|
|
@@ -174,7 +215,8 @@ class ReactApp {
|
|
|
174
215
|
entry: this.entry,
|
|
175
216
|
rootPath: '',
|
|
176
217
|
publicPath: `public/${this.name}`,
|
|
177
|
-
title: this.name
|
|
218
|
+
title: this.name,
|
|
219
|
+
favicon: this.favicon
|
|
178
220
|
});
|
|
179
221
|
}
|
|
180
222
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["react.application.ts"],"names":["ReactApp","constructor","name","entry","portRange","reactEnv","prerenderRoutes","bundler","devServer","transformers","deploy","run","context","from","to","port","Port","getPort","listen","devServerContext","getDevServerContext","getDevServer","configMutator","addTopLevel","historyApiFallback","index","disableDotRule","raw","output","publicPath","build","htmlConfig","title","templateContent","minify","Object","assign","html","getBundler","publicDir","getPublicDir","dir","getDefaultBundler","capsule","env","outputPath","path","distDir","getCompiler","entries","map","require","resolve","staticDir","bundlerContext","targets","components","component","rootPath","metaData","initiator","envId","id","defaultTransformer","config","addPlugin","applicationType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,QAAN,CAAsC;AAC3CC,EAAAA,WAAW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YAAY,GAAG;AACrB,WAAO,kBAAK,KAAK0B,eAAV,EAA2B,KAAKhE,IAAhC,CAAP;AACD;;AAEOkB,EAAAA,mBAAmB,CAACR,OAAD,EAAwC;AACjE,WAAOuB,MAAM,CAACC,MAAP,CAAcxB,OAAd,EAAuB;AAC5BT,MAAAA,KAAK,EAAE,KAAKA,KADgB;AAE5BuD,MAAAA,QAAQ,EAAE,EAFkB;AAG5B7B,MAAAA,UAAU,EAAG,UAAS,KAAK3B,IAAK,EAHJ;AAI5B8B,MAAAA,KAAK,EAAE,KAAK9B;AAJgB,KAAvB,CAAP;AAMD;;AA7G0C","sourcesContent":["import { join, basename } from 'path';\nimport { Application, AppContext, AppBuildContext } from '@teambit/application';\nimport { Bundler, DevServer, BundlerContext, DevServerContext, BundlerHtmlConfig } from '@teambit/bundler';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { WebpackConfigTransformer } from '@teambit/webpack';\nimport { ReactEnv } from '../../react.env';\nimport { prerenderSPAPlugin } from './plugins';\nimport { ReactAppBuildResult } from './react-build-result';\nimport { html } from '../../webpack';\nimport { ReactDeployContext } from '.';\n\nexport class ReactApp implements Application {\n constructor(\n readonly name: string,\n readonly entry: string[],\n readonly portRange: number[],\n private reactEnv: ReactEnv,\n readonly prerenderRoutes?: string[],\n readonly bundler?: Bundler,\n readonly devServer?: DevServer,\n readonly transformers?: WebpackConfigTransformer[],\n readonly deploy?: (context: ReactDeployContext) => Promise<void>\n ) {}\n\n readonly applicationType = 'react-common-js';\n readonly dir = 'public';\n async run(context: AppContext): Promise<number> {\n const [from, to] = this.portRange;\n const port = await Port.getPort(from, to);\n if (this.devServer) {\n await this.devServer.listen(port);\n return port;\n }\n const devServerContext = this.getDevServerContext(context);\n const devServer = this.reactEnv.getDevServer(devServerContext, [\n (configMutator) => {\n configMutator.addTopLevel('devServer', {\n historyApiFallback: {\n index: '/index.html',\n disableDotRule: true,\n },\n });\n\n if (!configMutator.raw.output) configMutator.raw.output = {};\n configMutator.raw.output.publicPath = '/';\n\n return configMutator;\n },\n ]);\n await devServer.listen(port);\n return port;\n }\n\n async build(context: AppBuildContext): Promise<ReactAppBuildResult> {\n const htmlConfig: BundlerHtmlConfig[] = [\n {\n title: context.name,\n templateContent: html(context.name),\n minify: false,\n // filename: ''.html`,\n },\n ];\n Object.assign(context, {\n html: htmlConfig,\n });\n const bundler = await this.getBundler(context);\n await bundler.run();\n return { publicDir: `${this.getPublicDir()}/${this.dir}` };\n }\n\n private getBundler(context: AppBuildContext) {\n if (this.bundler) return this.bundler;\n return this.getDefaultBundler(context);\n }\n private async getDefaultBundler(context: AppBuildContext) {\n const { capsule } = context;\n const reactEnv: ReactEnv = context.env;\n const publicDir = this.getPublicDir();\n const outputPath = join(capsule.path, publicDir);\n const { distDir } = reactEnv.getCompiler();\n const entries = this.entry.map((entry) => require.resolve(`${capsule.path}/${distDir}/${basename(entry)}`));\n const staticDir = join(outputPath, this.dir);\n\n const bundlerContext: BundlerContext = Object.assign(context, {\n targets: [\n {\n components: [capsule?.component],\n entries,\n outputPath,\n },\n ],\n entry: [],\n rootPath: '/',\n metaData: {\n initiator: `building app: ${context.name}`,\n envId: context.id,\n },\n });\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const config = configMutator.addTopLevel('output', { path: staticDir, publicPath: `/` });\n if (this.prerenderRoutes) config.addPlugin(prerenderSPAPlugin(this.prerenderRoutes, staticDir));\n return config;\n };\n const transformers = [defaultTransformer, ...(this.transformers ?? [])];\n const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers);\n return bundler;\n }\n\n private getPublicDir() {\n return join(this.applicationType, this.name);\n }\n\n private getDevServerContext(context: AppContext): DevServerContext {\n return Object.assign(context, {\n entry: this.entry,\n rootPath: '',\n publicPath: `public/${this.name}`,\n title: this.name,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["react.application.ts"],"names":["ReactApp","constructor","name","entry","portRange","reactEnv","prerenderRoutes","bundler","devServer","transformers","deploy","favicon","run","context","from","to","port","Port","getPort","listen","devServerContext","getDevServerContext","getDevServer","configMutator","addTopLevel","historyApiFallback","index","disableDotRule","raw","output","publicPath","build","htmlConfig","title","templateContent","minify","Object","assign","html","getBundler","publicDir","getPublicDir","dir","getDefaultBundler","capsule","env","outputPath","path","distDir","getCompiler","entries","map","require","resolve","staticDir","bundlerContext","targets","components","component","rootPath","metaData","initiator","envId","id","defaultTransformer","config","addPlugin","optimization","minimizer","push","TerserPlugin","esbuildMinify","terserOptions","applicationType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,QAAN,CAAsC;AAC3CC,EAAAA,WAAW,CACAC,IADA,EAEAC,KAFA,EAGAC,SAHA,EAIDC,QAJC,EAKAC,eALA,EAMAC,OANA,EAOAC,SAPA,EAQAC,YARA,EASAC,MATA,EAUAC,OAVA,EAWT;AAAA,SAVST,IAUT,GAVSA,IAUT;AAAA,SATSC,KAST,GATSA,KAST;AAAA,SARSC,SAQT,GARSA,SAQT;AAAA,SAPQC,QAOR,GAPQA,QAOR;AAAA,SANSC,eAMT,GANSA,eAMT;AAAA,SALSC,OAKT,GALSA,OAKT;AAAA,SAJSC,SAIT,GAJSA,SAIT;AAAA,SAHSC,YAGT,GAHSA,YAGT;AAAA,SAFSC,MAET,GAFSA,MAET;AAAA,SADSC,OACT,GADSA,OACT;AAAA,6DACyB,iBADzB;AAAA,iDAEa,QAFb;AAAE;;AAGK,QAAHC,GAAG,CAACC,OAAD,EAAuC;AAC9C,UAAM,CAACC,IAAD,EAAOC,EAAP,IAAa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AAP;AACD;;AAEOkC,EAAAA,YAAY,GAAG;AACrB,WAAO,kBAAK,KAAKgC,eAAV,EAA2B,KAAKvE,IAAhC,CAAP;AACD;;AAEOmB,EAAAA,mBAAmB,CAACR,OAAD,EAAwC;AACjE,WAAOuB,MAAM,CAACC,MAAP,CAAcxB,OAAd,EAAuB;AAC5BV,MAAAA,KAAK,EAAE,KAAKA,KADgB;AAE5BwD,MAAAA,QAAQ,EAAE,EAFkB;AAG5B7B,MAAAA,UAAU,EAAG,UAAS,KAAK5B,IAAK,EAHJ;AAI5B+B,MAAAA,KAAK,EAAE,KAAK/B,IAJgB;AAK5BS,MAAAA,OAAO,EAAE,KAAKA;AALc,KAAvB,CAAP;AAOD;;AA9H0C","sourcesContent":["import { join, basename } from 'path';\nimport { Application, AppContext, AppBuildContext } from '@teambit/application';\nimport { Bundler, DevServer, BundlerContext, DevServerContext, BundlerHtmlConfig } from '@teambit/bundler';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { remove } from 'lodash';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { WebpackConfigTransformer } from '@teambit/webpack';\nimport { ReactEnv } from '../../react.env';\nimport { prerenderSPAPlugin } from './plugins';\nimport { ReactAppBuildResult } from './react-build-result';\nimport { html } from '../../webpack';\nimport { ReactDeployContext } from '.';\n\nexport class ReactApp implements Application {\n constructor(\n readonly name: string,\n readonly entry: string[],\n readonly portRange: number[],\n private reactEnv: ReactEnv,\n readonly prerenderRoutes?: string[],\n readonly bundler?: Bundler,\n readonly devServer?: DevServer,\n readonly transformers?: WebpackConfigTransformer[],\n readonly deploy?: (context: ReactDeployContext) => Promise<void>,\n readonly favicon?: string\n ) {}\n readonly applicationType = 'react-common-js';\n readonly dir = 'public';\n async run(context: AppContext): Promise<number> {\n const [from, to] = this.portRange;\n const port = await Port.getPort(from, to);\n if (this.devServer) {\n await this.devServer.listen(port);\n return port;\n }\n const devServerContext = this.getDevServerContext(context);\n const devServer = this.reactEnv.getDevServer(devServerContext, [\n (configMutator) => {\n configMutator.addTopLevel('devServer', {\n historyApiFallback: {\n index: '/index.html',\n disableDotRule: true,\n },\n });\n\n if (!configMutator.raw.output) configMutator.raw.output = {};\n configMutator.raw.output.publicPath = '/';\n\n return configMutator;\n },\n ]);\n await devServer.listen(port);\n return port;\n }\n\n async build(context: AppBuildContext): Promise<ReactAppBuildResult> {\n const htmlConfig: BundlerHtmlConfig[] = [\n {\n title: context.name,\n templateContent: html(context.name),\n minify: false,\n favicon: this.favicon,\n // filename: ''.html`,\n },\n ];\n Object.assign(context, {\n html: htmlConfig,\n });\n const bundler = await this.getBundler(context);\n await bundler.run();\n return { publicDir: `${this.getPublicDir()}/${this.dir}` };\n }\n\n private getBundler(context: AppBuildContext) {\n if (this.bundler) return this.bundler;\n return this.getDefaultBundler(context);\n }\n private async getDefaultBundler(context: AppBuildContext) {\n const { capsule } = context;\n const reactEnv: ReactEnv = context.env;\n const publicDir = this.getPublicDir();\n const outputPath = join(capsule.path, publicDir);\n const { distDir } = reactEnv.getCompiler();\n const entries = this.entry.map((entry) => require.resolve(`${capsule.path}/${distDir}/${basename(entry)}`));\n const staticDir = join(outputPath, this.dir);\n\n const bundlerContext: BundlerContext = Object.assign(context, {\n targets: [\n {\n components: [capsule?.component],\n entries,\n outputPath,\n },\n ],\n entry: [],\n rootPath: '/',\n metaData: {\n initiator: `building app: ${context.name}`,\n envId: context.id,\n },\n });\n\n const defaultTransformer: WebpackConfigTransformer = (configMutator) => {\n const config = configMutator.addTopLevel('output', { path: staticDir, publicPath: `/` });\n if (this.prerenderRoutes) config.addPlugin(prerenderSPAPlugin(this.prerenderRoutes, staticDir));\n if (config.raw.optimization?.minimizer) {\n remove(config.raw.optimization?.minimizer, (minimizer) => {\n return minimizer.constructor.name === 'TerserPlugin';\n });\n config.raw.optimization?.minimizer.push(\n new TerserPlugin({\n minify: TerserPlugin.esbuildMinify,\n // `terserOptions` options will be passed to `esbuild`\n // Link to options - https://esbuild.github.io/api/#minify\n terserOptions: {\n minify: true,\n },\n })\n );\n }\n return config;\n };\n const transformers = [defaultTransformer, ...(this.transformers ?? [])];\n const bundler: Bundler = await reactEnv.getBundler(bundlerContext, transformers);\n return bundler;\n }\n\n private getPublicDir() {\n return join(this.applicationType, this.name);\n }\n\n private getDevServerContext(context: AppContext): DevServerContext {\n return Object.assign(context, {\n entry: this.entry,\n rootPath: '',\n publicPath: `public/${this.name}`,\n title: this.name,\n favicon: this.favicon,\n });\n }\n}\n"]}
|
|
@@ -73,44 +73,59 @@ function _default(externalizePeer, peers, dev) {
|
|
|
73
73
|
};
|
|
74
74
|
const optimization = dev ? undefined : {
|
|
75
75
|
minimize: true,
|
|
76
|
-
minimizer: [
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
minimizer: [new (_terserWebpackPlugin().default)({
|
|
77
|
+
minify: _terserWebpackPlugin().default.esbuildMinify,
|
|
78
|
+
// `terserOptions` options will be passed to `esbuild`
|
|
79
|
+
// Link to options - https://esbuild.github.io/api/#minify
|
|
80
|
+
// Note: the `minify` options is true by default (and override other `minify*` options), so if you want to disable the `minifyIdentifiers` option (or other `minify*` options) please use:
|
|
79
81
|
terserOptions: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
82
|
+
minify: false,
|
|
83
|
+
minifyWhitespace: true,
|
|
84
|
+
// We don't want to minify identifiers to enable easier debugging on remote scopes when there are preview issues
|
|
85
|
+
minifyIdentifiers: false,
|
|
86
|
+
// minifyIdentifiers: true,
|
|
87
|
+
minifySyntax: true
|
|
88
|
+
} // terserOptions: {},
|
|
89
|
+
|
|
90
|
+
}), // This is only used in production mode
|
|
91
|
+
// new TerserPlugin({
|
|
92
|
+
// extractComments: false,
|
|
93
|
+
// terserOptions: {
|
|
94
|
+
// parse: {
|
|
95
|
+
// // We want terser to parse ecma 8 code. However, we don't want it
|
|
96
|
+
// // to apply any minification steps that turns valid ecma 5 code
|
|
97
|
+
// // into invalid ecma 5 code. This is why the 'compress' and 'output'
|
|
98
|
+
// // sections only apply transformations that are ecma 5 safe
|
|
99
|
+
// // https://github.com/facebook/create-react-app/pull/4234
|
|
100
|
+
// ecma: 8,
|
|
101
|
+
// },
|
|
102
|
+
// compress: {
|
|
103
|
+
// ecma: 5,
|
|
104
|
+
// warnings: false,
|
|
105
|
+
// // Disabled because of an issue with Uglify breaking seemingly valid code:
|
|
106
|
+
// // https://github.com/facebook/create-react-app/issues/2376
|
|
107
|
+
// // Pending further investigation:
|
|
108
|
+
// // https://github.com/mishoo/UglifyJS2/issues/2011
|
|
109
|
+
// comparisons: false,
|
|
110
|
+
// // Disabled because of an issue with Terser breaking valid code:
|
|
111
|
+
// // https://github.com/facebook/create-react-app/issues/5250
|
|
112
|
+
// // Pending further investigation:
|
|
113
|
+
// // https://github.com/terser-js/terser/issues/120
|
|
114
|
+
// inline: 2,
|
|
115
|
+
// },
|
|
116
|
+
// mangle: {
|
|
117
|
+
// safari10: true,
|
|
118
|
+
// },
|
|
119
|
+
// output: {
|
|
120
|
+
// ecma: 5,
|
|
121
|
+
// comments: false,
|
|
122
|
+
// // Turned on because emoji and regex is not minified properly using default
|
|
123
|
+
// // https://github.com/facebook/create-react-app/issues/2488
|
|
124
|
+
// ascii_only: true,
|
|
125
|
+
// },
|
|
126
|
+
// },
|
|
127
|
+
// }),
|
|
128
|
+
new (_cssMinimizerWebpackPlugin().default)({
|
|
114
129
|
minimizerOptions: {
|
|
115
130
|
preset: ['default', {
|
|
116
131
|
minifyFontValues: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack.config.base.prod.ts"],"names":["externalizePeer","peers","dev","externals","undefined","exposedRules","module","rules","optimization","minimize","minimizer","TerserPlugin","
|
|
1
|
+
{"version":3,"sources":["webpack.config.base.prod.ts"],"names":["externalizePeer","peers","dev","externals","undefined","exposedRules","module","rules","optimization","minimize","minimizer","TerserPlugin","minify","esbuildMinify","terserOptions","minifyWhitespace","minifyIdentifiers","minifySyntax","CssMinimizerPlugin","minimizerOptions","preset","minifyFontValues","removeQuotes","plugins","WorkboxWebpackPlugin","GenerateSW","clientsClaim","exclude","navigateFallback","navigateFallbackDenylist","RegExp","filter","Boolean","performance"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAEA;AACA;AACA;AACe,kBAAUA,eAAV,EAAoCC,KAApC,EAAqDC,GAArD,EAAmF;AAChG,QAAMC,SAAS,GAAGH,eAAe,GAAI,kCAAaC,KAAb,CAAJ,GAAkCG,SAAnE;AACA,QAAMC,YAAY,GAAGL,eAAe,GAAGI,SAAH,GAAe,wCAAgBH,KAAhB,CAAnD;AAEA,QAAMK,MAAM,GAAGN,eAAe,GAC1BI,SAD0B,GAE1B;AACEG,IAAAA,KAAK,EAAEF;AADT,GAFJ;AAMA,QAAMG,YAAY,GAAGN,GAAG,GACpBE,SADoB,GAEpB;AACEK,IAAAA,QAAQ,EAAE,IADZ;AAEEC,IAAAA,SAAS,EAAE,CACT,KAAIC,8BAAJ,EAAiB;AACfC,MAAAA,MAAM,EAAED,+BAAaE,aADN;AAEf;AACA;A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xCA,CALJ;AA8CL;AACA;AACAC,IAAAA,WAAW,EAAE;AAhDR,GAAP;AAkDD","sourcesContent":["import WorkboxWebpackPlugin from 'workbox-webpack-plugin';\nimport CssMinimizerPlugin from 'css-minimizer-webpack-plugin';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { Configuration } from 'webpack';\nimport { getExternals } from './get-externals';\nimport { getExposedRules } from './get-exposed-rules';\n// import { WebpackManifestPlugin } from 'webpack-manifest-plugin';\n\n// This is the production and development configuration.\n// It is focused on developer experience, fast rebuilds, and a minimal bundle.\n// eslint-disable-next-line complexity\nexport default function (externalizePeer: boolean, peers: string[], dev?: boolean): Configuration {\n const externals = externalizePeer ? (getExternals(peers) as any) : undefined;\n const exposedRules = externalizePeer ? undefined : getExposedRules(peers);\n\n const module = externalizePeer\n ? undefined\n : {\n rules: exposedRules,\n };\n\n const optimization = dev\n ? undefined\n : {\n minimize: true,\n minimizer: [\n new TerserPlugin({\n minify: TerserPlugin.esbuildMinify,\n // `terserOptions` options will be passed to `esbuild`\n // Link to options - https://esbuild.github.io/api/#minify\n // Note: the `minify` options is true by default (and override other `minify*` options), so if you want to disable the `minifyIdentifiers` option (or other `minify*` options) please use:\n terserOptions: {\n minify: false,\n minifyWhitespace: true,\n // We don't want to minify identifiers to enable easier debugging on remote scopes when there are preview issues\n minifyIdentifiers: false,\n // minifyIdentifiers: true,\n minifySyntax: true,\n },\n // terserOptions: {},\n }),\n\n // This is only used in production mode\n // new TerserPlugin({\n // extractComments: false,\n // terserOptions: {\n // parse: {\n // // We want terser to parse ecma 8 code. However, we don't want it\n // // to apply any minification steps that turns valid ecma 5 code\n // // into invalid ecma 5 code. This is why the 'compress' and 'output'\n // // sections only apply transformations that are ecma 5 safe\n // // https://github.com/facebook/create-react-app/pull/4234\n // ecma: 8,\n // },\n // compress: {\n // ecma: 5,\n // warnings: false,\n // // Disabled because of an issue with Uglify breaking seemingly valid code:\n // // https://github.com/facebook/create-react-app/issues/2376\n // // Pending further investigation:\n // // https://github.com/mishoo/UglifyJS2/issues/2011\n // comparisons: false,\n // // Disabled because of an issue with Terser breaking valid code:\n // // https://github.com/facebook/create-react-app/issues/5250\n // // Pending further investigation:\n // // https://github.com/terser-js/terser/issues/120\n // inline: 2,\n // },\n // mangle: {\n // safari10: true,\n // },\n // output: {\n // ecma: 5,\n // comments: false,\n // // Turned on because emoji and regex is not minified properly using default\n // // https://github.com/facebook/create-react-app/issues/2488\n // ascii_only: true,\n // },\n // },\n // }),\n new CssMinimizerPlugin({\n minimizerOptions: {\n preset: [\n 'default',\n {\n minifyFontValues: { removeQuotes: false },\n },\n ],\n },\n }),\n ],\n // Automatically split vendor and commons\n // https://twitter.com/wSokra/status/969633336732905474\n // https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366\n // splitChunks: {\n // chunks: 'all',\n // name: false,\n // },\n // Keep the runtime chunk separated to enable long term caching\n // https://twitter.com/wSokra/status/969679223278505985\n // https://github.com/facebook/create-react-app/issues/5358\n // runtimeChunk: {\n // name: (entrypoint) => `runtime-${entrypoint.name}`,\n // },\n };\n\n return {\n module,\n externals,\n optimization,\n\n plugins: [\n // Generate an asset manifest file with the following content:\n // - \"files\" key: Mapping of all asset filenames to their corresponding\n // output file so that tools can pick it up without having to parse\n // `index.html`\n // can be used to reconstruct the HTML if necessary\n // new WebpackManifestPlugin({\n // fileName: 'asset-manifest.json',\n // publicPath: 'public',\n // generate: (seed, files, entrypoints) => {\n // const manifestFiles = files.reduce((manifest, file) => {\n // manifest[file.name] = file.path;\n // return manifest;\n // }, seed);\n // const entrypointFiles = entrypoints.main.filter((fileName) => !fileName.endsWith('.map'));\n\n // // @ts-ignore - https://github.com/shellscape/webpack-manifest-plugin/issues/276\n // return {\n // files: manifestFiles,\n // entrypoints: entrypointFiles,\n // } as Record<string, string>;\n // },\n // }),\n // Generate a service worker script that will precache, and keep up to date,\n // the HTML & assets that are part of the webpack build.\n new WorkboxWebpackPlugin.GenerateSW({\n clientsClaim: true,\n exclude: [/\\.map$/, /asset-manifest\\.json$/],\n // importWorkboxFrom: 'cdn',\n navigateFallback: 'public/index.html',\n navigateFallbackDenylist: [\n // Exclude URLs starting with /_, as they're likely an API call\n new RegExp('^/_'),\n // Exclude any URLs whose last part seems to be a file extension\n // as they're likely a resource and not a SPA route.\n // URLs containing a \"?\" character won't be blacklisted as they're likely\n // a route with query params (e.g. auth callbacks).\n new RegExp('/[^/?]+\\\\.[^/]+$'),\n ],\n }),\n ].filter(Boolean),\n // Turn off performance processing because we utilize\n // our own hints via the FileSizeReporter\n performance: false,\n };\n}\n"]}
|
|
File without changes
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.693",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/react/react",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.react",
|
|
8
8
|
"name": "react",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.693"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"react-error-boundary": "^3.0.0",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
72
72
|
"eslint-plugin-import": "2.22.1",
|
|
73
73
|
"eslint-plugin-jest": "24.1.5",
|
|
74
|
+
"esbuild": "0.14.28",
|
|
74
75
|
"@typescript-eslint/eslint-plugin": "4.30.0",
|
|
75
76
|
"@typescript-eslint/parser": "4.30.0",
|
|
76
77
|
"@svgr/webpack": "5.5.0",
|
|
@@ -79,38 +80,38 @@
|
|
|
79
80
|
"@teambit/react.instructions.react.adding-compositions": "0.0.6",
|
|
80
81
|
"@teambit/react.instructions.react.adding-tests": "0.0.6",
|
|
81
82
|
"@teambit/design.ui.pages.standalone-not-found-page": "0.0.356",
|
|
82
|
-
"@teambit/preview": "0.0.
|
|
83
|
+
"@teambit/preview": "0.0.693",
|
|
83
84
|
"@teambit/react.ui.error-fallback": "0.0.110",
|
|
84
85
|
"@teambit/react.ui.loader-fallback": "0.0.89",
|
|
85
86
|
"@teambit/compositions.ui.hooks.use-composition": "0.0.163",
|
|
86
87
|
"@teambit/design.ui.input.option-button": "0.0.26",
|
|
87
88
|
"@teambit/design.ui.tooltip": "0.0.352",
|
|
88
|
-
"@teambit/builder": "0.0.
|
|
89
|
-
"@teambit/bundler": "0.0.
|
|
90
|
-
"@teambit/compiler": "0.0.
|
|
89
|
+
"@teambit/builder": "0.0.693",
|
|
90
|
+
"@teambit/bundler": "0.0.693",
|
|
91
|
+
"@teambit/compiler": "0.0.693",
|
|
91
92
|
"@teambit/component.modules.component-url": "0.0.124",
|
|
92
|
-
"@teambit/component": "0.0.
|
|
93
|
-
"@teambit/envs": "0.0.
|
|
94
|
-
"@teambit/eslint": "0.0.
|
|
95
|
-
"@teambit/formatter": "0.0.
|
|
96
|
-
"@teambit/jest": "0.0.
|
|
97
|
-
"@teambit/linter": "0.0.
|
|
98
|
-
"@teambit/pkg": "0.0.
|
|
99
|
-
"@teambit/prettier": "0.0.
|
|
93
|
+
"@teambit/component": "0.0.693",
|
|
94
|
+
"@teambit/envs": "0.0.693",
|
|
95
|
+
"@teambit/eslint": "0.0.693",
|
|
96
|
+
"@teambit/formatter": "0.0.244",
|
|
97
|
+
"@teambit/jest": "0.0.693",
|
|
98
|
+
"@teambit/linter": "0.0.693",
|
|
99
|
+
"@teambit/pkg": "0.0.693",
|
|
100
|
+
"@teambit/prettier": "0.0.244",
|
|
100
101
|
"@teambit/react.ui.highlighter.component-metadata.bit-component-meta": "0.0.21",
|
|
101
|
-
"@teambit/schema": "0.0.
|
|
102
|
-
"@teambit/tester": "0.0.
|
|
103
|
-
"@teambit/typescript": "0.0.
|
|
104
|
-
"@teambit/webpack": "0.0.
|
|
105
|
-
"@teambit/workspace": "0.0.
|
|
106
|
-
"@teambit/application": "0.0.
|
|
107
|
-
"@teambit/cli": "0.0.
|
|
108
|
-
"@teambit/dependency-resolver": "0.0.
|
|
109
|
-
"@teambit/generator": "0.0.
|
|
110
|
-
"@teambit/graphql": "0.0.
|
|
102
|
+
"@teambit/schema": "0.0.693",
|
|
103
|
+
"@teambit/tester": "0.0.693",
|
|
104
|
+
"@teambit/typescript": "0.0.693",
|
|
105
|
+
"@teambit/webpack": "0.0.693",
|
|
106
|
+
"@teambit/workspace": "0.0.693",
|
|
107
|
+
"@teambit/application": "0.0.335",
|
|
108
|
+
"@teambit/cli": "0.0.463",
|
|
109
|
+
"@teambit/dependency-resolver": "0.0.693",
|
|
110
|
+
"@teambit/generator": "0.0.693",
|
|
111
|
+
"@teambit/graphql": "0.0.693",
|
|
111
112
|
"@teambit/react.ui.highlighter-provider": "0.0.185",
|
|
112
|
-
"@teambit/compositions": "0.0.
|
|
113
|
-
"@teambit/ui": "0.0.
|
|
113
|
+
"@teambit/compositions": "0.0.693",
|
|
114
|
+
"@teambit/ui": "0.0.693",
|
|
114
115
|
"@teambit/react.eslint-config-bit-react": "0.0.539",
|
|
115
116
|
"@teambit/webpack.modules.generate-expose-loaders": "0.0.3",
|
|
116
117
|
"@teambit/webpack.modules.generate-externals": "0.0.3",
|
|
@@ -121,7 +122,7 @@
|
|
|
121
122
|
"@teambit/webpack.modules.style-regexps": "0.0.132",
|
|
122
123
|
"@teambit/component-id": "0.0.402",
|
|
123
124
|
"@teambit/toolbox.network.get-port": "0.0.113",
|
|
124
|
-
"@teambit/config": "0.0.
|
|
125
|
+
"@teambit/config": "0.0.476"
|
|
125
126
|
},
|
|
126
127
|
"devDependencies": {
|
|
127
128
|
"@types/react": "^17.0.8",
|
|
@@ -180,6 +181,7 @@
|
|
|
180
181
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
181
182
|
"eslint-plugin-import": "2.22.1",
|
|
182
183
|
"eslint-plugin-jest": "24.1.5",
|
|
184
|
+
"esbuild": "0.14.28",
|
|
183
185
|
"@typescript-eslint/eslint-plugin": "4.30.0",
|
|
184
186
|
"@typescript-eslint/parser": "4.30.0",
|
|
185
187
|
"@babel/preset-react": "7.13.13",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.693/dist/react.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.react_react@0.0.693/dist/react.docs.mdx')]
|
|
@@ -24,44 +24,60 @@ export default function (externalizePeer: boolean, peers: string[], dev?: boolea
|
|
|
24
24
|
: {
|
|
25
25
|
minimize: true,
|
|
26
26
|
minimizer: [
|
|
27
|
-
// This is only used in production mode
|
|
28
27
|
new TerserPlugin({
|
|
29
|
-
|
|
28
|
+
minify: TerserPlugin.esbuildMinify,
|
|
29
|
+
// `terserOptions` options will be passed to `esbuild`
|
|
30
|
+
// Link to options - https://esbuild.github.io/api/#minify
|
|
31
|
+
// Note: the `minify` options is true by default (and override other `minify*` options), so if you want to disable the `minifyIdentifiers` option (or other `minify*` options) please use:
|
|
30
32
|
terserOptions: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ecma: 8,
|
|
38
|
-
},
|
|
39
|
-
compress: {
|
|
40
|
-
ecma: 5,
|
|
41
|
-
warnings: false,
|
|
42
|
-
// Disabled because of an issue with Uglify breaking seemingly valid code:
|
|
43
|
-
// https://github.com/facebook/create-react-app/issues/2376
|
|
44
|
-
// Pending further investigation:
|
|
45
|
-
// https://github.com/mishoo/UglifyJS2/issues/2011
|
|
46
|
-
comparisons: false,
|
|
47
|
-
// Disabled because of an issue with Terser breaking valid code:
|
|
48
|
-
// https://github.com/facebook/create-react-app/issues/5250
|
|
49
|
-
// Pending further investigation:
|
|
50
|
-
// https://github.com/terser-js/terser/issues/120
|
|
51
|
-
inline: 2,
|
|
52
|
-
},
|
|
53
|
-
mangle: {
|
|
54
|
-
safari10: true,
|
|
55
|
-
},
|
|
56
|
-
output: {
|
|
57
|
-
ecma: 5,
|
|
58
|
-
comments: false,
|
|
59
|
-
// Turned on because emoji and regex is not minified properly using default
|
|
60
|
-
// https://github.com/facebook/create-react-app/issues/2488
|
|
61
|
-
ascii_only: true,
|
|
62
|
-
},
|
|
33
|
+
minify: false,
|
|
34
|
+
minifyWhitespace: true,
|
|
35
|
+
// We don't want to minify identifiers to enable easier debugging on remote scopes when there are preview issues
|
|
36
|
+
minifyIdentifiers: false,
|
|
37
|
+
// minifyIdentifiers: true,
|
|
38
|
+
minifySyntax: true,
|
|
63
39
|
},
|
|
40
|
+
// terserOptions: {},
|
|
64
41
|
}),
|
|
42
|
+
|
|
43
|
+
// This is only used in production mode
|
|
44
|
+
// new TerserPlugin({
|
|
45
|
+
// extractComments: false,
|
|
46
|
+
// terserOptions: {
|
|
47
|
+
// parse: {
|
|
48
|
+
// // We want terser to parse ecma 8 code. However, we don't want it
|
|
49
|
+
// // to apply any minification steps that turns valid ecma 5 code
|
|
50
|
+
// // into invalid ecma 5 code. This is why the 'compress' and 'output'
|
|
51
|
+
// // sections only apply transformations that are ecma 5 safe
|
|
52
|
+
// // https://github.com/facebook/create-react-app/pull/4234
|
|
53
|
+
// ecma: 8,
|
|
54
|
+
// },
|
|
55
|
+
// compress: {
|
|
56
|
+
// ecma: 5,
|
|
57
|
+
// warnings: false,
|
|
58
|
+
// // Disabled because of an issue with Uglify breaking seemingly valid code:
|
|
59
|
+
// // https://github.com/facebook/create-react-app/issues/2376
|
|
60
|
+
// // Pending further investigation:
|
|
61
|
+
// // https://github.com/mishoo/UglifyJS2/issues/2011
|
|
62
|
+
// comparisons: false,
|
|
63
|
+
// // Disabled because of an issue with Terser breaking valid code:
|
|
64
|
+
// // https://github.com/facebook/create-react-app/issues/5250
|
|
65
|
+
// // Pending further investigation:
|
|
66
|
+
// // https://github.com/terser-js/terser/issues/120
|
|
67
|
+
// inline: 2,
|
|
68
|
+
// },
|
|
69
|
+
// mangle: {
|
|
70
|
+
// safari10: true,
|
|
71
|
+
// },
|
|
72
|
+
// output: {
|
|
73
|
+
// ecma: 5,
|
|
74
|
+
// comments: false,
|
|
75
|
+
// // Turned on because emoji and regex is not minified properly using default
|
|
76
|
+
// // https://github.com/facebook/create-react-app/issues/2488
|
|
77
|
+
// ascii_only: true,
|
|
78
|
+
// },
|
|
79
|
+
// },
|
|
80
|
+
// }),
|
|
65
81
|
new CssMinimizerPlugin({
|
|
66
82
|
minimizerOptions: {
|
|
67
83
|
preset: [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_teambit_legacy=self.webpackChunk_teambit_legacy||[]).push([[384],{12858:(e,t,a)=>{var n=a(74649),s=(a(16738),a(677));(0,n.Bu)("compositions",{mainModule:s,isSplitComponentBundle:!0,componentMap:{}})}},e=>{e.O(0,[283,750,677],(()=>{return t=12858,e(e.s=t);var t}));e.O()}]);
|