@teambit/react 0.0.804 → 0.0.807
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/compute-results.ts +3 -1
- package/apps/web/react-app-options.ts +6 -1
- package/apps/web/react-build-result.ts +1 -0
- package/apps/web/react.app-type.ts +1 -0
- package/apps/web/react.application.ts +62 -83
- package/apps/web/webpack/mutators.ts +69 -0
- package/apps/web/webpack/webpack.app.ssr.config.ts +24 -0
- package/artifacts/__bit_junit.xml +2 -2
- package/artifacts/env-template/public/{22.20acd98351f2158a41da.js → 22.0f657f2dfdd8e90d81ba.js} +0 -0
- package/artifacts/env-template/public/{994.bb73ab7fa3ec9ae9dc3b.js → 502.1f3ad81d16d1a387ed6e.js} +19 -11
- package/artifacts/env-template/public/assets-manifest.json +14 -14
- package/artifacts/env-template/public/{compositions.52254428c46016cd7126.js → compositions.1a2eae0121924a2382b5.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.feaf6bb95eb88100792c.js → overview.4c90e935a13e148728cc.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/peers.9bf322cedc753fa8456b.js +1 -0
- package/artifacts/env-template/public/{preview-root.3a0d522c80063747b87d.js → preview-root.6f380ef699dc27c5b1d6.js} +1 -1
- package/artifacts/env-template/public/static/css/{994.90cfc900.css → 502.f6840c3e.css} +1 -1
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1659347901202.js → compositions-1659583874630.js} +0 -0
- package/dist/apps/web/compute-results.d.ts +2 -1
- package/dist/apps/web/compute-results.js +3 -1
- package/dist/apps/web/compute-results.js.map +1 -1
- package/dist/apps/web/react-app-options.d.ts +5 -1
- package/dist/apps/web/react-app-options.js.map +1 -1
- package/dist/apps/web/react-build-result.d.ts +1 -0
- package/dist/apps/web/react-build-result.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 +8 -4
- package/dist/apps/web/react.application.js +62 -95
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/apps/web/webpack/mutators.d.ts +3 -0
- package/dist/apps/web/webpack/mutators.js +91 -0
- package/dist/apps/web/webpack/mutators.js.map +1 -1
- package/dist/apps/web/webpack/webpack.app.ssr.config.d.ts +6 -0
- package/dist/apps/web/webpack/webpack.app.ssr.config.js +29 -0
- package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
- package/dist/react.main.runtime.d.ts +3 -2
- package/dist/react.main.runtime.js +4 -3
- package/dist/react.main.runtime.js.map +1 -1
- package/dist/webpack/webpack.config.base.js +15 -1
- package/dist/webpack/webpack.config.base.js.map +1 -1
- package/{overview-1659347901202.js → overview-1659583874630.js} +0 -0
- package/package-tar/teambit-react-0.0.807.tgz +0 -0
- package/package.json +32 -30
- package/{preview-1659347901202.js → preview-1659583874630.js} +2 -2
- package/webpack/webpack.config.base.ts +2 -1
- package/artifacts/env-template/public/peers.1d2b76311bfbf98a86fc.js +0 -1
- package/package-tar/teambit-react-0.0.804.tgz +0 -0
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.addDevServer = addDevServer;
|
|
9
|
+
exports.replaceTerserPlugin = replaceTerserPlugin;
|
|
7
10
|
exports.setOutput = setOutput;
|
|
8
11
|
|
|
12
|
+
function _lodash() {
|
|
13
|
+
const data = require("lodash");
|
|
14
|
+
|
|
15
|
+
_lodash = function () {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _terserWebpackPlugin() {
|
|
23
|
+
const data = _interopRequireDefault(require("terser-webpack-plugin"));
|
|
24
|
+
|
|
25
|
+
_terserWebpackPlugin = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
9
32
|
function addDevServer(configMutator) {
|
|
10
33
|
return configMutator.addTopLevel('devServer', {
|
|
34
|
+
allowedHosts: 'all',
|
|
11
35
|
historyApiFallback: {
|
|
12
36
|
index: '/index.html',
|
|
13
37
|
disableDotRule: true
|
|
@@ -24,4 +48,71 @@ function setOutput(configMutator) {
|
|
|
24
48
|
return configMutator;
|
|
25
49
|
}
|
|
26
50
|
|
|
51
|
+
function replaceTerserPlugin({
|
|
52
|
+
prerender = false
|
|
53
|
+
}) {
|
|
54
|
+
return configMutator => {
|
|
55
|
+
var _configMutator$raw$op, _configMutator$raw$op2, _configMutator$raw$op3;
|
|
56
|
+
|
|
57
|
+
if (!((_configMutator$raw$op = configMutator.raw.optimization) !== null && _configMutator$raw$op !== void 0 && _configMutator$raw$op.minimizer)) return configMutator;
|
|
58
|
+
(0, _lodash().remove)((_configMutator$raw$op2 = configMutator.raw.optimization) === null || _configMutator$raw$op2 === void 0 ? void 0 : _configMutator$raw$op2.minimizer, minimizer => {
|
|
59
|
+
return minimizer.constructor.name === 'TerserPlugin';
|
|
60
|
+
});
|
|
61
|
+
const terserer = prerender ? CreateTerserPluginForPrerender() : CreateTerserPlugin();
|
|
62
|
+
(_configMutator$raw$op3 = configMutator.raw.optimization) === null || _configMutator$raw$op3 === void 0 ? void 0 : _configMutator$raw$op3.minimizer.push(terserer);
|
|
63
|
+
return configMutator;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function CreateTerserPlugin() {
|
|
68
|
+
return new (_terserWebpackPlugin().default)({
|
|
69
|
+
minify: _terserWebpackPlugin().default.esbuildMinify,
|
|
70
|
+
// `terserOptions` options will be passed to `esbuild`
|
|
71
|
+
// Link to options - https://esbuild.github.io/api/#minify
|
|
72
|
+
terserOptions: {
|
|
73
|
+
minify: true
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function CreateTerserPluginForPrerender() {
|
|
79
|
+
return new (_terserWebpackPlugin().default)({
|
|
80
|
+
extractComments: false,
|
|
81
|
+
terserOptions: {
|
|
82
|
+
parse: {
|
|
83
|
+
// We want terser to parse ecma 8 code. However, we don't want it
|
|
84
|
+
// to apply any minification steps that turns valid ecma 5 code
|
|
85
|
+
// into invalid ecma 5 code. This is why the 'compress' and 'output'
|
|
86
|
+
// sections only apply transformations that are ecma 5 safe
|
|
87
|
+
// https://github.com/facebook/create-react-app/pull/4234
|
|
88
|
+
ecma: 8
|
|
89
|
+
},
|
|
90
|
+
compress: {
|
|
91
|
+
ecma: 5,
|
|
92
|
+
warnings: false,
|
|
93
|
+
// Disabled because of an issue with Uglify breaking seemingly valid code:
|
|
94
|
+
// https://github.com/facebook/create-react-app/issues/2376
|
|
95
|
+
// Pending further investigation:
|
|
96
|
+
// https://github.com/mishoo/UglifyJS2/issues/2011
|
|
97
|
+
comparisons: false,
|
|
98
|
+
// Disabled because of an issue with Terser breaking valid code:
|
|
99
|
+
// https://github.com/facebook/create-react-app/issues/5250
|
|
100
|
+
// Pending further investigation:
|
|
101
|
+
// https://github.com/terser-js/terser/issues/120
|
|
102
|
+
inline: 2
|
|
103
|
+
},
|
|
104
|
+
mangle: {
|
|
105
|
+
safari10: true
|
|
106
|
+
},
|
|
107
|
+
output: {
|
|
108
|
+
ecma: 5,
|
|
109
|
+
comments: false,
|
|
110
|
+
// Turned on because emoji and regex is not minified properly using default
|
|
111
|
+
// https://github.com/facebook/create-react-app/issues/2488
|
|
112
|
+
ascii_only: true
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
27
118
|
//# sourceMappingURL=mutators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["addDevServer","configMutator","addTopLevel","historyApiFallback","index","disableDotRule","headers","setOutput","raw","output","publicPath"],"sources":["mutators.ts"],"sourcesContent":["import { WebpackConfigMutator } from '@teambit/webpack';\n\nexport function addDevServer(configMutator: WebpackConfigMutator) {\n return configMutator.addTopLevel('devServer', {\n historyApiFallback: {\n index: '/index.html',\n disableDotRule: true,\n },\n headers: {\n 'Access-Control-Allow-Origin': '*',\n },\n });\n}\n\nexport function setOutput(configMutator: WebpackConfigMutator) {\n if (!configMutator.raw.output) configMutator.raw.output = {};\n configMutator.raw.output.publicPath = '/';\n\n return configMutator;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["addDevServer","configMutator","addTopLevel","allowedHosts","historyApiFallback","index","disableDotRule","headers","setOutput","raw","output","publicPath","replaceTerserPlugin","prerender","optimization","minimizer","remove","constructor","name","terserer","CreateTerserPluginForPrerender","CreateTerserPlugin","push","TerserPlugin","minify","esbuildMinify","terserOptions","extractComments","parse","ecma","compress","warnings","comparisons","inline","mangle","safari10","comments","ascii_only"],"sources":["mutators.ts"],"sourcesContent":["import { WebpackConfigMutator } from '@teambit/webpack';\nimport { remove } from 'lodash';\nimport TerserPlugin from 'terser-webpack-plugin';\n\nexport function addDevServer(configMutator: WebpackConfigMutator) {\n return configMutator.addTopLevel('devServer', {\n allowedHosts: 'all',\n historyApiFallback: {\n index: '/index.html',\n disableDotRule: true,\n },\n headers: {\n 'Access-Control-Allow-Origin': '*',\n },\n });\n}\n\nexport function setOutput(configMutator: WebpackConfigMutator) {\n if (!configMutator.raw.output) configMutator.raw.output = {};\n configMutator.raw.output.publicPath = '/';\n\n return configMutator;\n}\n\nexport function replaceTerserPlugin({ prerender = false }: { prerender: boolean }) {\n return (configMutator: WebpackConfigMutator) => {\n if (!configMutator.raw.optimization?.minimizer) return configMutator;\n\n remove(configMutator.raw.optimization?.minimizer, (minimizer) => {\n return minimizer.constructor.name === 'TerserPlugin';\n });\n\n const terserer = prerender ? CreateTerserPluginForPrerender() : CreateTerserPlugin();\n configMutator.raw.optimization?.minimizer.push(terserer);\n\n return configMutator;\n };\n}\n\nfunction CreateTerserPlugin() {\n return 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\nfunction CreateTerserPluginForPrerender() {\n return 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}\n"],"mappings":";;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,SAASA,YAAT,CAAsBC,aAAtB,EAA2D;EAChE,OAAOA,aAAa,CAACC,WAAd,CAA0B,WAA1B,EAAuC;IAC5CC,YAAY,EAAE,KAD8B;IAE5CC,kBAAkB,EAAE;MAClBC,KAAK,EAAE,aADW;MAElBC,cAAc,EAAE;IAFE,CAFwB;IAM5CC,OAAO,EAAE;MACP,+BAA+B;IADxB;EANmC,CAAvC,CAAP;AAUD;;AAEM,SAASC,SAAT,CAAmBP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AERE,QAAQ,EAAE,KAFF;QAGR;QACA;QACA;QACA;QACAC,WAAW,EAAE,KAPL;QAQR;QACA;QACA;QACA;QACAC,MAAM,EAAE;MAZA,CATG;MAuBbC,MAAM,EAAE;QACNC,QAAQ,EAAE;MADJ,CAvBK;MA0BbzB,MAAM,EAAE;QACNmB,IAAI,EAAE,CADA;QAENO,QAAQ,EAAE,KAFJ;QAGN;QACA;QACAC,UAAU,EAAE;MALN;IA1BK;EAFO,CAAjB,CAAP;AAqCD"}
|
|
@@ -12,4 +12,10 @@ declare enum Targets {
|
|
|
12
12
|
export declare function calcOutputPath(appName: string, target: Targets | keyof typeof Targets): string;
|
|
13
13
|
export declare function clientConfig(): Configuration;
|
|
14
14
|
export declare function ssrConfig(): Configuration;
|
|
15
|
+
export declare function buildConfig({ outputPath }: {
|
|
16
|
+
outputPath: string;
|
|
17
|
+
}): Configuration;
|
|
18
|
+
export declare function ssrBuildConfig({ outputPath }: {
|
|
19
|
+
outputPath: string;
|
|
20
|
+
}): Configuration;
|
|
15
21
|
export {};
|
|
@@ -4,8 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SSR_ENTRY_FILE = exports.PUBLIC_PATH = void 0;
|
|
7
|
+
exports.buildConfig = buildConfig;
|
|
7
8
|
exports.calcOutputPath = calcOutputPath;
|
|
8
9
|
exports.clientConfig = clientConfig;
|
|
10
|
+
exports.ssrBuildConfig = ssrBuildConfig;
|
|
9
11
|
exports.ssrConfig = ssrConfig;
|
|
10
12
|
|
|
11
13
|
function _path() {
|
|
@@ -59,4 +61,31 @@ function ssrConfig() {
|
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
function buildConfig({
|
|
65
|
+
outputPath
|
|
66
|
+
}) {
|
|
67
|
+
return {
|
|
68
|
+
output: {
|
|
69
|
+
path: outputPath,
|
|
70
|
+
publicPath: `/`,
|
|
71
|
+
filename: '[name].[chunkhash].js'
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function ssrBuildConfig({
|
|
77
|
+
outputPath
|
|
78
|
+
}) {
|
|
79
|
+
return {
|
|
80
|
+
target: 'node',
|
|
81
|
+
devtool: 'eval-cheap-source-map',
|
|
82
|
+
output: {
|
|
83
|
+
path: outputPath,
|
|
84
|
+
publicPath: `/`,
|
|
85
|
+
libraryTarget: 'commonjs',
|
|
86
|
+
filename: 'index.js'
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
62
91
|
//# sourceMappingURL=webpack.app.ssr.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OUTPUT_FOLDER","SSR_ENTRY_FILE","PUBLIC_PATH","Targets","calcOutputPath","appName","target","join","clientConfig","output","publicPath","filename","ssrConfig","devtool","libraryTarget"],"sources":["webpack.app.ssr.config.ts"],"sourcesContent":["import { join } from 'path';\nimport type { Configuration } from 'webpack';\n\nconst OUTPUT_FOLDER = 'public/bit-apps';\nexport const SSR_ENTRY_FILE = 'index.js';\n/** _external_ base url for static files. (is not a folder)\n * @example\n * \"http://localhost:3000/public/main.88a88d47d86aaabc0230.js\"\n */\nexport const PUBLIC_PATH = '/public';\n\nenum Targets {\n ssr = 'ssr',\n browser = 'browser',\n}\n\nexport function calcOutputPath(appName: string, target: Targets | keyof typeof Targets) {\n return join(OUTPUT_FOLDER, appName, target);\n}\n\nexport function clientConfig(): Configuration {\n return {\n output: { publicPath: PUBLIC_PATH, filename: '[name].[chunkhash].js' },\n };\n}\n\nexport function ssrConfig(): Configuration {\n return {\n target: 'node',\n devtool: 'eval-cheap-source-map',\n\n output: {\n libraryTarget: 'commonjs',\n filename: SSR_ENTRY_FILE,\n },\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["OUTPUT_FOLDER","SSR_ENTRY_FILE","PUBLIC_PATH","Targets","calcOutputPath","appName","target","join","clientConfig","output","publicPath","filename","ssrConfig","devtool","libraryTarget","buildConfig","outputPath","path","ssrBuildConfig"],"sources":["webpack.app.ssr.config.ts"],"sourcesContent":["import { join } from 'path';\nimport type { Configuration } from 'webpack';\n\nconst OUTPUT_FOLDER = 'public/bit-apps';\nexport const SSR_ENTRY_FILE = 'index.js';\n/** _external_ base url for static files. (is not a folder)\n * @example\n * \"http://localhost:3000/public/main.88a88d47d86aaabc0230.js\"\n */\nexport const PUBLIC_PATH = '/public';\n\nenum Targets {\n ssr = 'ssr',\n browser = 'browser',\n}\n\nexport function calcOutputPath(appName: string, target: Targets | keyof typeof Targets) {\n return join(OUTPUT_FOLDER, appName, target);\n}\n\nexport function clientConfig(): Configuration {\n return {\n output: { publicPath: PUBLIC_PATH, filename: '[name].[chunkhash].js' },\n };\n}\n\nexport function ssrConfig(): Configuration {\n return {\n target: 'node',\n devtool: 'eval-cheap-source-map',\n\n output: {\n libraryTarget: 'commonjs',\n filename: SSR_ENTRY_FILE,\n },\n };\n}\n\nexport function buildConfig({ outputPath }: { outputPath: string }): Configuration {\n return {\n output: {\n path: outputPath,\n publicPath: `/`,\n filename: '[name].[chunkhash].js',\n },\n };\n}\n\nexport function ssrBuildConfig({ outputPath }: { outputPath: string }): Configuration {\n return {\n target: 'node',\n devtool: 'eval-cheap-source-map',\n\n output: {\n path: outputPath,\n publicPath: `/`,\n libraryTarget: 'commonjs',\n filename: 'index.js',\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA,MAAMA,aAAa,GAAG,iBAAtB;AACO,MAAMC,cAAc,GAAG,UAAvB;AACP;AACA;AACA;AACA;;;AACO,MAAMC,WAAW,GAAG,SAApB;;IAEFC,O;;WAAAA,O;EAAAA,O;EAAAA,O;GAAAA,O,KAAAA,O;;AAKE,SAASC,cAAT,CAAwBC,OAAxB,EAAyCC,MAAzC,EAAiF;EACtF,OAAO,IAAAC,YAAA,EAAKP,aAAL,EAAoBK,OAApB,EAA6BC,MAA7B,CAAP;AACD;;AAEM,SAASE,YAAT,GAAuC;EAC5C,OAAO;IACLC,MAAM,EAAE;MAAEC,UAAU,EAAER,WAAd;MAA2BS,QAAQ,EAAE;IAArC;EADH,CAAP;AAGD;;AAEM,SAASC,SAAT,GAAoC;EACzC,OAAO;IACLN,MAAM,EAAE,MADH;IAELO,OAAO,EAAE,uBAFJ;IAILJ,MAAM,EAAE;MACNK,aAAa,EAAE,UADT;MAENH,QAAQ,EAAEV;IAFJ;EAJH,CAAP;AASD;;AAEM,SAASc,WAAT,CAAqB;EAAEC;AAAF,CAArB,EAA4E;EACjF,OAAO;IACLP,MAAM,EAAE;MACNQ,IAAI,EAAED,UADA;MAENN,UAAU,EAAG,GAFP;MAGNC,QAAQ,EAAE;IAHJ;EADH,CAAP;AAOD;;AAEM,SAASO,cAAT,CAAwB;EAAEF;AAAF,CAAxB,EAA+E;EACpF,OAAO;IACLV,MAAM,EAAE,MADH;IAELO,OAAO,EAAE,uBAFJ;IAILJ,MAAM,EAAE;MACNQ,IAAI,EAAED,UADA;MAENN,UAAU,EAAG,GAFP;MAGNI,aAAa,EAAE,UAHT;MAINH,QAAQ,EAAE;IAJJ;EAJH,CAAP;AAWD"}
|
|
@@ -13,7 +13,7 @@ import { GeneratorMain } from '@teambit/generator';
|
|
|
13
13
|
import { Workspace } from '@teambit/workspace';
|
|
14
14
|
import { DependencyResolverMain, EnvPolicyConfigObject } from '@teambit/dependency-resolver';
|
|
15
15
|
import { ApplicationMain } from '@teambit/application';
|
|
16
|
-
import { LoggerMain } from '@teambit/logger';
|
|
16
|
+
import { Logger, LoggerMain } from '@teambit/logger';
|
|
17
17
|
import { ESLintMain, EslintConfigTransformer } from '@teambit/eslint';
|
|
18
18
|
import { PrettierMain, PrettierConfigTransformer } from '@teambit/prettier';
|
|
19
19
|
import { ReactEnv } from './react.env';
|
|
@@ -74,11 +74,12 @@ export declare class ReactMain {
|
|
|
74
74
|
private envs;
|
|
75
75
|
private application;
|
|
76
76
|
private reactAppType;
|
|
77
|
+
private logger?;
|
|
77
78
|
constructor(
|
|
78
79
|
/**
|
|
79
80
|
* an instance of the React env.
|
|
80
81
|
*/
|
|
81
|
-
reactEnv: ReactEnv, envs: EnvsMain, application: ApplicationMain, reactAppType: ReactAppType);
|
|
82
|
+
reactEnv: ReactEnv, envs: EnvsMain, application: ApplicationMain, reactAppType: ReactAppType, logger?: Logger | undefined);
|
|
82
83
|
readonly env: ReactEnv;
|
|
83
84
|
getReactAppType(name: string): ReactAppType;
|
|
84
85
|
/**
|
|
@@ -272,16 +272,17 @@ class ReactMain {
|
|
|
272
272
|
/**
|
|
273
273
|
* an instance of the React env.
|
|
274
274
|
*/
|
|
275
|
-
reactEnv, envs, application, reactAppType) {
|
|
275
|
+
reactEnv, envs, application, reactAppType, logger) {
|
|
276
276
|
this.reactEnv = reactEnv;
|
|
277
277
|
this.envs = envs;
|
|
278
278
|
this.application = application;
|
|
279
279
|
this.reactAppType = reactAppType;
|
|
280
|
+
this.logger = logger;
|
|
280
281
|
(0, _defineProperty2().default)(this, "env", this.reactEnv);
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
getReactAppType(name) {
|
|
284
|
-
return new (_web().ReactAppType)(name, this.reactEnv);
|
|
285
|
+
return new (_web().ReactAppType)(name, this.reactEnv, this.logger);
|
|
285
286
|
}
|
|
286
287
|
/**
|
|
287
288
|
* use this to register apps programmatically.
|
|
@@ -589,7 +590,7 @@ class ReactMain {
|
|
|
589
590
|
const logger = loggerMain.createLogger(_react().ReactAspect.id);
|
|
590
591
|
const reactEnv = new (_react2().ReactEnv)(jestAspect, tsAspect, compiler, webpack, workspace, pkg, tester, config, eslint, prettier, dependencyResolver, logger, _compiler().CompilerAspect.id);
|
|
591
592
|
const appType = new (_web().ReactAppType)('react-app', reactEnv, logger);
|
|
592
|
-
const react = new ReactMain(reactEnv, envs, application, appType);
|
|
593
|
+
const react = new ReactMain(reactEnv, envs, application, appType, logger);
|
|
593
594
|
graphql.register((0, _react3().reactSchema)(react));
|
|
594
595
|
envs.registerEnv(reactEnv);
|
|
595
596
|
generator.registerComponentTemplate(_react4().componentTemplates);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReactMain","constructor","reactEnv","envs","application","reactAppType","getReactAppType","name","ReactAppType","registerApp","reactApp","createApp","useTypescript","modifiers","tsModule","ts","overrides","devTransformers","devConfig","getCompiler","buildTransformers","buildConfig","buildPipeModifiers","tsModifier","transformers","module","getBuildPipe","override","overrideTsConfig","tsconfig","compilerOptions","transformer","configMutator","mergeTsConfig","raw","compileJs","compileJsx","types","addTypes","genericCompilerOptions","omit","Object","assign","overrideDocsTemplate","templatePath","getDevEnvId","context","envDefinition","id","getDocsTemplate","overrideBuildTsConfig","useWebpack","devServerTransformers","devServerConfig","getDevServer","previewTransformers","previewConfig","getBundler","useEslint","getLinter","usePrettier","getFormatter","overrideDevServerConfig","config","merge","overridePreviewConfig","overrideMounter","mounterPath","getMounter","compose","targetEnv","overrideJestConfig","jestConfigPath","jestModulePath","getTester","overrideBuildPipe","tasks","overrideCompilerTasks","pipeWithoutCompiler","getBuildPipeWithoutCompiler","overrideDependencies","dependencyPolicy","getDependencies","reactDeps","mergeDeepLeft","overrideCompiler","compiler","overrideEslintConfig","overridePackageJsonProps","props","getPackageJsonProps","getDocs","component","docsArray","state","_consumer","docs","abstract","description","filePath","properties","provider","jestAspect","tsAspect","webpack","workspace","graphql","pkg","tester","eslint","prettier","generator","dependencyResolver","loggerMain","logger","createLogger","ReactAspect","ReactEnv","CompilerAspect","appType","react","register","reactSchema","registerEnv","registerComponentTemplate","componentTemplates","registerWorkspaceTemplate","workspaceTemplates","registerAppType","MainRuntime","EnvsAspect","JestAspect","TypescriptAspect","WebpackAspect","WorkspaceAspect","GraphqlAspect","PkgAspect","TesterAspect","ESLintAspect","PrettierAspect","ApplicationAspect","GeneratorAspect","DependencyResolverAspect","LoggerAspect","addRuntime"],"sources":["react.main.runtime.ts"],"sourcesContent":["import mergeDeepLeft from 'ramda/src/mergeDeepLeft';\nimport { omit } from 'lodash';\nimport { MainRuntime } from '@teambit/cli';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect, Compiler } from '@teambit/compiler';\nimport { BuildTask } from '@teambit/builder';\nimport { Component } from '@teambit/component';\nimport { EnvsAspect, EnvsMain, EnvTransformer, Environment } from '@teambit/envs';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport type { JestMain } from '@teambit/jest';\nimport { JestAspect } from '@teambit/jest';\nimport type { PkgMain, PackageJsonProps } from '@teambit/pkg';\nimport { PkgAspect } from '@teambit/pkg';\nimport type { TesterMain } from '@teambit/tester';\nimport { TesterAspect } from '@teambit/tester';\nimport type { TypescriptMain, TsCompilerOptionsWithoutTsConfig, TsConfigTransformer } from '@teambit/typescript';\nimport { TypescriptAspect } from '@teambit/typescript';\nimport type { WebpackMain, Configuration, WebpackConfigTransformer } from '@teambit/webpack';\nimport { WebpackAspect } from '@teambit/webpack';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { DevServerContext, BundlerContext } from '@teambit/bundler';\nimport { DependencyResolverAspect, DependencyResolverMain, EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport ts from 'typescript';\nimport { ApplicationAspect, ApplicationMain } from '@teambit/application';\nimport { FormatterContext } from '@teambit/formatter';\nimport { LinterContext } from '@teambit/linter';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { ESLintMain, ESLintAspect, EslintConfigTransformer } from '@teambit/eslint';\nimport { PrettierMain, PrettierAspect, PrettierConfigTransformer } from '@teambit/prettier';\nimport { ReactAspect } from './react.aspect';\nimport { ReactEnv } from './react.env';\nimport { ReactAppType } from './apps/web';\nimport { reactSchema } from './react.graphql';\nimport { componentTemplates, workspaceTemplates } from './react.templates';\nimport { ReactAppOptions } from './apps/web/react-app-options';\n\ntype ReactDeps = [\n EnvsMain,\n JestMain,\n TypescriptMain,\n CompilerMain,\n WebpackMain,\n Workspace,\n GraphqlMain,\n PkgMain,\n TesterMain,\n ESLintMain,\n PrettierMain,\n ApplicationMain,\n GeneratorMain,\n DependencyResolverMain,\n LoggerMain\n];\n\nexport type ReactMainConfig = {\n /**\n * configure the react env compiler.\n * can be configured to either TypeScript ('ts') or Babel ('babel').\n */\n compiler: 'babel' | 'ts';\n\n /**\n * configure the component tester.\n * can be either Jest ('jest') or Mocha ('mocha')\n */\n tester: 'jest' | 'mocha';\n\n /**\n * version of React to configure.\n */\n reactVersion: string;\n};\n\nexport type UseWebpackModifiers = {\n previewConfig?: WebpackConfigTransformer[];\n devServerConfig?: WebpackConfigTransformer[];\n};\n\nexport type UseTypescriptModifiers = {\n buildConfig?: TsConfigTransformer[];\n devConfig?: TsConfigTransformer[];\n};\n\nexport type UseEslintModifiers = {\n transformers: EslintConfigTransformer[];\n};\nexport type UsePrettierModifiers = {\n transformers: PrettierConfigTransformer[];\n};\n\nexport class ReactMain {\n constructor(\n /**\n * an instance of the React env.\n */\n readonly reactEnv: ReactEnv,\n\n private envs: EnvsMain,\n\n private application: ApplicationMain,\n\n private reactAppType: ReactAppType\n ) {}\n\n readonly env = this.reactEnv;\n\n getReactAppType(name: string) {\n return new ReactAppType(name, this.reactEnv);\n }\n\n /**\n * use this to register apps programmatically.\n */\n async registerApp(reactApp: ReactAppOptions) {\n return this.application.registerApp(this.reactAppType.createApp(reactApp));\n }\n\n /**\n * override the env's typescript config for both dev and build time.\n * Replaces both overrideTsConfig (devConfig) and overrideBuildTsConfig (buildConfig)\n */\n useTypescript(modifiers?: UseTypescriptModifiers, tsModule: any = ts) {\n const overrides: any = {};\n const devTransformers = modifiers?.devConfig;\n if (devTransformers) {\n overrides.getCompiler = () => this.reactEnv.getCompiler(devTransformers, tsModule);\n }\n const buildTransformers = modifiers?.buildConfig;\n if (buildTransformers) {\n const buildPipeModifiers = {\n tsModifier: {\n transformers: buildTransformers,\n module: tsModule,\n },\n };\n overrides.getBuildPipe = () => this.reactEnv.getBuildPipe(buildPipeModifiers);\n }\n return this.envs.override(overrides);\n }\n\n /**\n * @deprecated use useTypescript()\n * override the TS config of the React environment.\n * @param tsModule typeof `ts` module instance.\n */\n overrideTsConfig(\n tsconfig: Record<string, any> = {},\n compilerOptions: Partial<TsCompilerOptionsWithoutTsConfig> = {},\n tsModule: any = ts\n ) {\n const transformer: TsConfigTransformer = (configMutator) => {\n configMutator.mergeTsConfig(tsconfig);\n configMutator.raw.compileJs = compilerOptions.compileJs ?? configMutator.raw.compileJs;\n configMutator.raw.compileJsx = compilerOptions.compileJsx ?? configMutator.raw.compileJsx;\n if (compilerOptions.types) {\n configMutator.addTypes(compilerOptions.types);\n }\n const genericCompilerOptions = omit(compilerOptions, ['types', 'compileJs', 'compileJsx']);\n configMutator.raw = Object.assign(configMutator.raw, genericCompilerOptions);\n return configMutator;\n };\n // return this.envs.override({\n // getCompiler: () => this.reactEnv.getCompiler([transformer], tsModule),\n // });\n return this.useTypescript({ devConfig: [transformer] }, tsModule);\n }\n\n /**\n * Override the Bit documentation link. See docs: https://bit.dev/docs/docs/doc-templates\n */\n overrideDocsTemplate(templatePath: string) {\n return this.envs.override({\n getDevEnvId: (context: DevServerContext) => this.reactEnv.getDevEnvId(context.envDefinition.id),\n getDocsTemplate: () => templatePath,\n });\n }\n\n /**\n * @deprecated use useTypescript()\n * override the build tsconfig.\n */\n overrideBuildTsConfig(\n tsconfig: Record<string, any> = {},\n compilerOptions: Partial<TsCompilerOptionsWithoutTsConfig> = {},\n tsModule: any = ts\n ) {\n const transformer: TsConfigTransformer = (configMutator) => {\n configMutator.mergeTsConfig(tsconfig);\n configMutator.raw.compileJs = compilerOptions.compileJs ?? configMutator.raw.compileJs;\n configMutator.raw.compileJsx = compilerOptions.compileJsx ?? configMutator.raw.compileJsx;\n if (compilerOptions.types) {\n configMutator.addTypes(compilerOptions.types);\n }\n const genericCompilerOptions = omit(compilerOptions, ['types', 'compileJs', 'compileJsx']);\n configMutator.raw = Object.assign(configMutator.raw, genericCompilerOptions);\n return configMutator;\n };\n // return this.envs.override({\n // getBuildPipe: () => this.reactEnv.getBuildPipe([transformer], tsModule),\n // });\n return this.useTypescript({ buildConfig: [transformer] }, tsModule);\n }\n\n /**\n * override the env's dev server and preview webpack configurations.\n * Replaces both overrideDevServerConfig and overridePreviewConfig\n */\n useWebpack(modifiers?: UseWebpackModifiers): EnvTransformer {\n const overrides: any = {};\n const devServerTransformers = modifiers?.devServerConfig;\n if (devServerTransformers) {\n overrides.getDevServer = (context: DevServerContext) =>\n this.reactEnv.getDevServer(context, devServerTransformers);\n overrides.getDevEnvId = (context: DevServerContext) => this.reactEnv.getDevEnvId(context.envDefinition.id);\n }\n const previewTransformers = modifiers?.previewConfig;\n if (previewTransformers) {\n overrides.getBundler = (context: BundlerContext) => this.reactEnv.getBundler(context, previewTransformers);\n }\n return this.envs.override(overrides);\n }\n\n /**\n * An API to mutate the prettier config\n * @param modifiers\n * @returns\n */\n useEslint(modifiers?: UseEslintModifiers): EnvTransformer {\n const transformers = modifiers?.transformers || [];\n return this.envs.override({\n getLinter: (context: LinterContext) => this.reactEnv.getLinter(context, transformers),\n });\n }\n\n /**\n * An API to mutate the prettier config\n * @param modifiers\n * @returns\n */\n usePrettier(modifiers?: UsePrettierModifiers): EnvTransformer {\n const transformers = modifiers?.transformers || [];\n return this.envs.override({\n getFormatter: (context: FormatterContext) => this.reactEnv.getFormatter(context, transformers),\n });\n }\n\n /**\n * @deprecated use useWebpack()\n * override the dev server webpack config.\n */\n overrideDevServerConfig(config: Configuration) {\n const transformer: WebpackConfigTransformer = (configMutator) => {\n return configMutator.merge([config]);\n };\n\n return this.envs.override({\n getDevServer: (context: DevServerContext) => this.reactEnv.getDevServer(context, [transformer]),\n getDevEnvId: (context: DevServerContext) => this.reactEnv.getDevEnvId(context.envDefinition.id),\n });\n }\n\n /**\n * @deprecated use useWebpack()\n * override the preview webpack config.\n */\n overridePreviewConfig(config: Configuration) {\n const transformer: WebpackConfigTransformer = (configMutator) => {\n return configMutator.merge([config]);\n };\n return this.envs.override({\n getBundler: (context: BundlerContext) => this.reactEnv.getBundler(context, [transformer]),\n });\n }\n\n overrideMounter(mounterPath: string) {\n return this.envs.override({\n getMounter: () => {\n return mounterPath;\n },\n });\n }\n\n /**\n * create a new composition of the react environment.\n */\n compose(transformers: EnvTransformer[], targetEnv: Environment = {}) {\n return this.envs.compose(this.envs.merge(targetEnv, this.reactEnv), transformers);\n }\n\n /**\n * override the jest configuration.\n * @param jestConfigPath {typeof jest} absolute path to jest.config.json.\n * @param jestModulePath absolute path to jest\n */\n overrideJestConfig(jestConfigPath: string, jestModulePath?: string) {\n return this.envs.override({\n getTester: () => this.reactEnv.getTester(jestConfigPath, jestModulePath),\n });\n }\n\n /**\n * override the build pipeline of the component environment.\n */\n overrideBuildPipe(tasks: BuildTask[]) {\n return this.envs.override({\n getBuildPipe: () => tasks,\n });\n }\n\n /**\n * override the compiler tasks inside the build pipeline of the component environment.\n */\n overrideCompilerTasks(tasks: BuildTask[]) {\n const pipeWithoutCompiler = this.reactEnv.getBuildPipeWithoutCompiler();\n\n return this.envs.override({\n getBuildPipe: () => [...tasks, ...pipeWithoutCompiler],\n });\n }\n\n /**\n * override the dependency configuration of the component environment.\n */\n overrideDependencies(dependencyPolicy: EnvPolicyConfigObject) {\n return this.envs.override({\n getDependencies: async () => {\n const reactDeps = await this.reactEnv.getDependencies();\n return mergeDeepLeft(dependencyPolicy, reactDeps);\n },\n });\n }\n\n /**\n * override the workspace compiler.\n */\n overrideCompiler(compiler: Compiler) {\n return this.envs.override({\n getCompiler: () => {\n return compiler;\n },\n });\n }\n\n /**\n * TODO: @gilad we need to implement this.\n */\n overrideEslintConfig() {}\n\n /**\n * override the package json props of the component environment.\n */\n overridePackageJsonProps(props: PackageJsonProps) {\n return this.envs.override({\n getPackageJsonProps: () => {\n return {\n ...this.reactEnv.getPackageJsonProps(),\n ...props,\n };\n },\n });\n }\n\n /**\n * returns doc adjusted specifically for react components.\n */\n getDocs(component: Component) {\n const docsArray = component.state._consumer.docs;\n if (!docsArray || !docsArray[0]) {\n return null;\n }\n\n const docs = docsArray[0];\n\n return {\n abstract: docs.description,\n filePath: docs.filePath,\n properties: docs.properties,\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n EnvsAspect,\n JestAspect,\n TypescriptAspect,\n CompilerAspect,\n WebpackAspect,\n WorkspaceAspect,\n GraphqlAspect,\n PkgAspect,\n TesterAspect,\n ESLintAspect,\n PrettierAspect,\n ApplicationAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n LoggerAspect,\n ];\n\n static async provider(\n [\n envs,\n jestAspect,\n tsAspect,\n compiler,\n webpack,\n workspace,\n graphql,\n pkg,\n tester,\n eslint,\n prettier,\n application,\n generator,\n dependencyResolver,\n loggerMain,\n ]: ReactDeps,\n config: ReactMainConfig\n ) {\n const logger = loggerMain.createLogger(ReactAspect.id);\n const reactEnv = new ReactEnv(\n jestAspect,\n tsAspect,\n compiler,\n webpack,\n workspace,\n pkg,\n tester,\n config,\n eslint,\n prettier,\n dependencyResolver,\n logger,\n CompilerAspect.id\n );\n const appType = new ReactAppType('react-app', reactEnv, logger);\n const react = new ReactMain(reactEnv, envs, application, appType);\n graphql.register(reactSchema(react));\n envs.registerEnv(reactEnv);\n generator.registerComponentTemplate(componentTemplates);\n generator.registerWorkspaceTemplate(workspaceTemplates);\n application.registerAppType(appType);\n\n return react;\n }\n}\n\nReactAspect.addRuntime(ReactMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;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0BAXoB,EAYpBC,gCAZoB,EAapBC,4BAboB,EAcpBC,8CAdoB,EAepBC,sBAfoB,C;;AAkExB3B,oBAAA,CAAY4B,UAAZ,CAAuBhJ,SAAvB"}
|
|
1
|
+
{"version":3,"names":["ReactMain","constructor","reactEnv","envs","application","reactAppType","logger","getReactAppType","name","ReactAppType","registerApp","reactApp","createApp","useTypescript","modifiers","tsModule","ts","overrides","devTransformers","devConfig","getCompiler","buildTransformers","buildConfig","buildPipeModifiers","tsModifier","transformers","module","getBuildPipe","override","overrideTsConfig","tsconfig","compilerOptions","transformer","configMutator","mergeTsConfig","raw","compileJs","compileJsx","types","addTypes","genericCompilerOptions","omit","Object","assign","overrideDocsTemplate","templatePath","getDevEnvId","context","envDefinition","id","getDocsTemplate","overrideBuildTsConfig","useWebpack","devServerTransformers","devServerConfig","getDevServer","previewTransformers","previewConfig","getBundler","useEslint","getLinter","usePrettier","getFormatter","overrideDevServerConfig","config","merge","overridePreviewConfig","overrideMounter","mounterPath","getMounter","compose","targetEnv","overrideJestConfig","jestConfigPath","jestModulePath","getTester","overrideBuildPipe","tasks","overrideCompilerTasks","pipeWithoutCompiler","getBuildPipeWithoutCompiler","overrideDependencies","dependencyPolicy","getDependencies","reactDeps","mergeDeepLeft","overrideCompiler","compiler","overrideEslintConfig","overridePackageJsonProps","props","getPackageJsonProps","getDocs","component","docsArray","state","_consumer","docs","abstract","description","filePath","properties","provider","jestAspect","tsAspect","webpack","workspace","graphql","pkg","tester","eslint","prettier","generator","dependencyResolver","loggerMain","createLogger","ReactAspect","ReactEnv","CompilerAspect","appType","react","register","reactSchema","registerEnv","registerComponentTemplate","componentTemplates","registerWorkspaceTemplate","workspaceTemplates","registerAppType","MainRuntime","EnvsAspect","JestAspect","TypescriptAspect","WebpackAspect","WorkspaceAspect","GraphqlAspect","PkgAspect","TesterAspect","ESLintAspect","PrettierAspect","ApplicationAspect","GeneratorAspect","DependencyResolverAspect","LoggerAspect","addRuntime"],"sources":["react.main.runtime.ts"],"sourcesContent":["import mergeDeepLeft from 'ramda/src/mergeDeepLeft';\nimport { omit } from 'lodash';\nimport { MainRuntime } from '@teambit/cli';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect, Compiler } from '@teambit/compiler';\nimport { BuildTask } from '@teambit/builder';\nimport { Component } from '@teambit/component';\nimport { EnvsAspect, EnvsMain, EnvTransformer, Environment } from '@teambit/envs';\nimport type { GraphqlMain } from '@teambit/graphql';\nimport { GraphqlAspect } from '@teambit/graphql';\nimport type { JestMain } from '@teambit/jest';\nimport { JestAspect } from '@teambit/jest';\nimport type { PkgMain, PackageJsonProps } from '@teambit/pkg';\nimport { PkgAspect } from '@teambit/pkg';\nimport type { TesterMain } from '@teambit/tester';\nimport { TesterAspect } from '@teambit/tester';\nimport type { TypescriptMain, TsCompilerOptionsWithoutTsConfig, TsConfigTransformer } from '@teambit/typescript';\nimport { TypescriptAspect } from '@teambit/typescript';\nimport type { WebpackMain, Configuration, WebpackConfigTransformer } from '@teambit/webpack';\nimport { WebpackAspect } from '@teambit/webpack';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { DevServerContext, BundlerContext } from '@teambit/bundler';\nimport { DependencyResolverAspect, DependencyResolverMain, EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport ts from 'typescript';\nimport { ApplicationAspect, ApplicationMain } from '@teambit/application';\nimport { FormatterContext } from '@teambit/formatter';\nimport { LinterContext } from '@teambit/linter';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { ESLintMain, ESLintAspect, EslintConfigTransformer } from '@teambit/eslint';\nimport { PrettierMain, PrettierAspect, PrettierConfigTransformer } from '@teambit/prettier';\nimport { ReactAspect } from './react.aspect';\nimport { ReactEnv } from './react.env';\nimport { ReactAppType } from './apps/web';\nimport { reactSchema } from './react.graphql';\nimport { componentTemplates, workspaceTemplates } from './react.templates';\nimport { ReactAppOptions } from './apps/web/react-app-options';\n\ntype ReactDeps = [\n EnvsMain,\n JestMain,\n TypescriptMain,\n CompilerMain,\n WebpackMain,\n Workspace,\n GraphqlMain,\n PkgMain,\n TesterMain,\n ESLintMain,\n PrettierMain,\n ApplicationMain,\n GeneratorMain,\n DependencyResolverMain,\n LoggerMain\n];\n\nexport type ReactMainConfig = {\n /**\n * configure the react env compiler.\n * can be configured to either TypeScript ('ts') or Babel ('babel').\n */\n compiler: 'babel' | 'ts';\n\n /**\n * configure the component tester.\n * can be either Jest ('jest') or Mocha ('mocha')\n */\n tester: 'jest' | 'mocha';\n\n /**\n * version of React to configure.\n */\n reactVersion: string;\n};\n\nexport type UseWebpackModifiers = {\n previewConfig?: WebpackConfigTransformer[];\n devServerConfig?: WebpackConfigTransformer[];\n};\n\nexport type UseTypescriptModifiers = {\n buildConfig?: TsConfigTransformer[];\n devConfig?: TsConfigTransformer[];\n};\n\nexport type UseEslintModifiers = {\n transformers: EslintConfigTransformer[];\n};\nexport type UsePrettierModifiers = {\n transformers: PrettierConfigTransformer[];\n};\n\nexport class ReactMain {\n constructor(\n /**\n * an instance of the React env.\n */\n readonly reactEnv: ReactEnv,\n\n private envs: EnvsMain,\n\n private application: ApplicationMain,\n\n private reactAppType: ReactAppType,\n\n private logger?: Logger,\n ) {}\n\n readonly env = this.reactEnv;\n\n getReactAppType(name: string) {\n return new ReactAppType(name, this.reactEnv, this.logger);\n }\n\n /**\n * use this to register apps programmatically.\n */\n async registerApp(reactApp: ReactAppOptions) {\n return this.application.registerApp(this.reactAppType.createApp(reactApp));\n }\n\n /**\n * override the env's typescript config for both dev and build time.\n * Replaces both overrideTsConfig (devConfig) and overrideBuildTsConfig (buildConfig)\n */\n useTypescript(modifiers?: UseTypescriptModifiers, tsModule: any = ts) {\n const overrides: any = {};\n const devTransformers = modifiers?.devConfig;\n if (devTransformers) {\n overrides.getCompiler = () => this.reactEnv.getCompiler(devTransformers, tsModule);\n }\n const buildTransformers = modifiers?.buildConfig;\n if (buildTransformers) {\n const buildPipeModifiers = {\n tsModifier: {\n transformers: buildTransformers,\n module: tsModule,\n },\n };\n overrides.getBuildPipe = () => this.reactEnv.getBuildPipe(buildPipeModifiers);\n }\n return this.envs.override(overrides);\n }\n\n /**\n * @deprecated use useTypescript()\n * override the TS config of the React environment.\n * @param tsModule typeof `ts` module instance.\n */\n overrideTsConfig(\n tsconfig: Record<string, any> = {},\n compilerOptions: Partial<TsCompilerOptionsWithoutTsConfig> = {},\n tsModule: any = ts\n ) {\n const transformer: TsConfigTransformer = (configMutator) => {\n configMutator.mergeTsConfig(tsconfig);\n configMutator.raw.compileJs = compilerOptions.compileJs ?? configMutator.raw.compileJs;\n configMutator.raw.compileJsx = compilerOptions.compileJsx ?? configMutator.raw.compileJsx;\n if (compilerOptions.types) {\n configMutator.addTypes(compilerOptions.types);\n }\n const genericCompilerOptions = omit(compilerOptions, ['types', 'compileJs', 'compileJsx']);\n configMutator.raw = Object.assign(configMutator.raw, genericCompilerOptions);\n return configMutator;\n };\n // return this.envs.override({\n // getCompiler: () => this.reactEnv.getCompiler([transformer], tsModule),\n // });\n return this.useTypescript({ devConfig: [transformer] }, tsModule);\n }\n\n /**\n * Override the Bit documentation link. See docs: https://bit.dev/docs/docs/doc-templates\n */\n overrideDocsTemplate(templatePath: string) {\n return this.envs.override({\n getDevEnvId: (context: DevServerContext) => this.reactEnv.getDevEnvId(context.envDefinition.id),\n getDocsTemplate: () => templatePath,\n });\n }\n\n /**\n * @deprecated use useTypescript()\n * override the build tsconfig.\n */\n overrideBuildTsConfig(\n tsconfig: Record<string, any> = {},\n compilerOptions: Partial<TsCompilerOptionsWithoutTsConfig> = {},\n tsModule: any = ts\n ) {\n const transformer: TsConfigTransformer = (configMutator) => {\n configMutator.mergeTsConfig(tsconfig);\n configMutator.raw.compileJs = compilerOptions.compileJs ?? configMutator.raw.compileJs;\n configMutator.raw.compileJsx = compilerOptions.compileJsx ?? configMutator.raw.compileJsx;\n if (compilerOptions.types) {\n configMutator.addTypes(compilerOptions.types);\n }\n const genericCompilerOptions = omit(compilerOptions, ['types', 'compileJs', 'compileJsx']);\n configMutator.raw = Object.assign(configMutator.raw, genericCompilerOptions);\n return configMutator;\n };\n // return this.envs.override({\n // getBuildPipe: () => this.reactEnv.getBuildPipe([transformer], tsModule),\n // });\n return this.useTypescript({ buildConfig: [transformer] }, tsModule);\n }\n\n /**\n * override the env's dev server and preview webpack configurations.\n * Replaces both overrideDevServerConfig and overridePreviewConfig\n */\n useWebpack(modifiers?: UseWebpackModifiers): EnvTransformer {\n const overrides: any = {};\n const devServerTransformers = modifiers?.devServerConfig;\n if (devServerTransformers) {\n overrides.getDevServer = (context: DevServerContext) =>\n this.reactEnv.getDevServer(context, devServerTransformers);\n overrides.getDevEnvId = (context: DevServerContext) => this.reactEnv.getDevEnvId(context.envDefinition.id);\n }\n const previewTransformers = modifiers?.previewConfig;\n if (previewTransformers) {\n overrides.getBundler = (context: BundlerContext) => this.reactEnv.getBundler(context, previewTransformers);\n }\n return this.envs.override(overrides);\n }\n\n /**\n * An API to mutate the prettier config\n * @param modifiers\n * @returns\n */\n useEslint(modifiers?: UseEslintModifiers): EnvTransformer {\n const transformers = modifiers?.transformers || [];\n return this.envs.override({\n getLinter: (context: LinterContext) => this.reactEnv.getLinter(context, transformers),\n });\n }\n\n /**\n * An API to mutate the prettier config\n * @param modifiers\n * @returns\n */\n usePrettier(modifiers?: UsePrettierModifiers): EnvTransformer {\n const transformers = modifiers?.transformers || [];\n return this.envs.override({\n getFormatter: (context: FormatterContext) => this.reactEnv.getFormatter(context, transformers),\n });\n }\n\n /**\n * @deprecated use useWebpack()\n * override the dev server webpack config.\n */\n overrideDevServerConfig(config: Configuration) {\n const transformer: WebpackConfigTransformer = (configMutator) => {\n return configMutator.merge([config]);\n };\n\n return this.envs.override({\n getDevServer: (context: DevServerContext) => this.reactEnv.getDevServer(context, [transformer]),\n getDevEnvId: (context: DevServerContext) => this.reactEnv.getDevEnvId(context.envDefinition.id),\n });\n }\n\n /**\n * @deprecated use useWebpack()\n * override the preview webpack config.\n */\n overridePreviewConfig(config: Configuration) {\n const transformer: WebpackConfigTransformer = (configMutator) => {\n return configMutator.merge([config]);\n };\n return this.envs.override({\n getBundler: (context: BundlerContext) => this.reactEnv.getBundler(context, [transformer]),\n });\n }\n\n overrideMounter(mounterPath: string) {\n return this.envs.override({\n getMounter: () => {\n return mounterPath;\n },\n });\n }\n\n /**\n * create a new composition of the react environment.\n */\n compose(transformers: EnvTransformer[], targetEnv: Environment = {}) {\n return this.envs.compose(this.envs.merge(targetEnv, this.reactEnv), transformers);\n }\n\n /**\n * override the jest configuration.\n * @param jestConfigPath {typeof jest} absolute path to jest.config.json.\n * @param jestModulePath absolute path to jest\n */\n overrideJestConfig(jestConfigPath: string, jestModulePath?: string) {\n return this.envs.override({\n getTester: () => this.reactEnv.getTester(jestConfigPath, jestModulePath),\n });\n }\n\n /**\n * override the build pipeline of the component environment.\n */\n overrideBuildPipe(tasks: BuildTask[]) {\n return this.envs.override({\n getBuildPipe: () => tasks,\n });\n }\n\n /**\n * override the compiler tasks inside the build pipeline of the component environment.\n */\n overrideCompilerTasks(tasks: BuildTask[]) {\n const pipeWithoutCompiler = this.reactEnv.getBuildPipeWithoutCompiler();\n\n return this.envs.override({\n getBuildPipe: () => [...tasks, ...pipeWithoutCompiler],\n });\n }\n\n /**\n * override the dependency configuration of the component environment.\n */\n overrideDependencies(dependencyPolicy: EnvPolicyConfigObject) {\n return this.envs.override({\n getDependencies: async () => {\n const reactDeps = await this.reactEnv.getDependencies();\n return mergeDeepLeft(dependencyPolicy, reactDeps);\n },\n });\n }\n\n /**\n * override the workspace compiler.\n */\n overrideCompiler(compiler: Compiler) {\n return this.envs.override({\n getCompiler: () => {\n return compiler;\n },\n });\n }\n\n /**\n * TODO: @gilad we need to implement this.\n */\n overrideEslintConfig() {}\n\n /**\n * override the package json props of the component environment.\n */\n overridePackageJsonProps(props: PackageJsonProps) {\n return this.envs.override({\n getPackageJsonProps: () => {\n return {\n ...this.reactEnv.getPackageJsonProps(),\n ...props,\n };\n },\n });\n }\n\n /**\n * returns doc adjusted specifically for react components.\n */\n getDocs(component: Component) {\n const docsArray = component.state._consumer.docs;\n if (!docsArray || !docsArray[0]) {\n return null;\n }\n\n const docs = docsArray[0];\n\n return {\n abstract: docs.description,\n filePath: docs.filePath,\n properties: docs.properties,\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n EnvsAspect,\n JestAspect,\n TypescriptAspect,\n CompilerAspect,\n WebpackAspect,\n WorkspaceAspect,\n GraphqlAspect,\n PkgAspect,\n TesterAspect,\n ESLintAspect,\n PrettierAspect,\n ApplicationAspect,\n GeneratorAspect,\n DependencyResolverAspect,\n LoggerAspect,\n ];\n\n static async provider(\n [\n envs,\n jestAspect,\n tsAspect,\n compiler,\n webpack,\n workspace,\n graphql,\n pkg,\n tester,\n eslint,\n prettier,\n application,\n generator,\n dependencyResolver,\n loggerMain,\n ]: ReactDeps,\n config: ReactMainConfig\n ) {\n const logger = loggerMain.createLogger(ReactAspect.id);\n const reactEnv = new ReactEnv(\n jestAspect,\n tsAspect,\n compiler,\n webpack,\n workspace,\n pkg,\n tester,\n config,\n eslint,\n prettier,\n dependencyResolver,\n logger,\n CompilerAspect.id\n );\n const appType = new ReactAppType('react-app', reactEnv, logger);\n const react = new ReactMain(reactEnv, envs, application, appType, logger);\n graphql.register(reactSchema(react));\n envs.registerEnv(reactEnv);\n generator.registerComponentTemplate(componentTemplates);\n generator.registerWorkspaceTemplate(workspaceTemplates);\n application.registerAppType(appType);\n\n return react;\n }\n}\n\nReactAspect.addRuntime(ReactMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EA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0BAJoB,EAKpBe,wBALoB,EAMpBC,4BANoB,EAOpBC,wBAPoB,EAQpBC,gBARoB,EASpBC,sBAToB,EAUpBC,sBAVoB,EAWpBC,0BAXoB,EAYpBC,gCAZoB,EAapBC,4BAboB,EAcpBC,8CAdoB,EAepBC,sBAfoB,C;;AAkExB3B,oBAAA,CAAY4B,UAAZ,CAAuBhJ,SAAvB"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
require("core-js/modules/es.regexp.constructor.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
8
|
+
|
|
5
9
|
Object.defineProperty(exports, "__esModule", {
|
|
6
10
|
value: true
|
|
7
11
|
});
|
|
@@ -27,6 +31,16 @@ function _lodash() {
|
|
|
27
31
|
return data;
|
|
28
32
|
}
|
|
29
33
|
|
|
34
|
+
function _path() {
|
|
35
|
+
const data = require("path");
|
|
36
|
+
|
|
37
|
+
_path = function () {
|
|
38
|
+
return data;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
|
|
30
44
|
require("style-loader");
|
|
31
45
|
|
|
32
46
|
function _miniCssExtractPlugin() {
|
|
@@ -392,7 +406,7 @@ function _default(isEnvProduction = false) {
|
|
|
392
406
|
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
|
|
393
407
|
// You can remove this if you don't use Moment.js:
|
|
394
408
|
new (_webpack().IgnorePlugin)({
|
|
395
|
-
resourceRegExp:
|
|
409
|
+
resourceRegExp: new RegExp(`^\\.${_path().sep}locale$`),
|
|
396
410
|
contextRegExp: /moment$/
|
|
397
411
|
})].filter(Boolean),
|
|
398
412
|
// Turn off performance processing because we utilize
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styleLoaderPath","require","resolve","moduleFileExtensions","shouldUseSourceMap","process","env","GENERATE_SOURCEMAP","imageInlineSizeLimit","parseInt","IMAGE_INLINE_SIZE_LIMIT","isEnvProduction","isEnvProductionProfile","argv","includes","baseStyleLoadersOptions","injectingLoader","MiniCssExtractPlugin","loader","cssLoaderPath","postCssLoaderPath","postCssConfig","extensions","map","ext","alias","module","strictExportPresence","rules","test","fullySpecified","oneOf","stylesRegexps","cssNoModulesRegex","use","generateStyleLoaders","merge","cssLoaderOpts","importLoaders","sourceMap","sideEffects","exclude","options","babelrc","configFile","customize","presets","cacheDirectory","cacheCompression","compact","cssModuleRegex","modules","getLocalIdent","getCSSModuleLocalIdent","sassNoModuleRegex","preProcessOptions","resolveUrlLoaderPath","preProcessorPath","sassModuleRegex","lessNoModuleRegex","lessModuleRegex","type","parser","dataUrlCondition","maxSize","generator","filename","dependency","not","titleProp","ref","plugins","chunkFilename","IgnorePlugin","resourceRegExp","contextRegExp","filter","Boolean","performance"],"sources":["webpack.config.base.ts"],"sourcesContent":["import { merge } from 'lodash';\nimport 'style-loader';\nimport MiniCssExtractPlugin from 'mini-css-extract-plugin';\nimport getCSSModuleLocalIdent from 'react-dev-utils/getCSSModuleLocalIdent';\nimport { Configuration, IgnorePlugin } from 'webpack';\nimport * as stylesRegexps from '@teambit/webpack.modules.style-regexps';\nimport { generateStyleLoaders } from '@teambit/webpack.modules.generate-style-loaders';\nimport { postCssConfig } from './postcss.config';\n// Make sure the bit-react-transformer is a dependency\n// TODO: remove it once we can set policy from component to component then set it via the component.json\nimport '@teambit/react.babel.bit-react-transformer';\n// Make sure the mdx-loader is a dependency\nimport '@teambit/mdx.modules.mdx-loader';\n\nconst styleLoaderPath = require.resolve('style-loader');\n\nconst moduleFileExtensions = [\n 'web.mjs',\n 'mjs',\n 'web.js',\n 'js',\n 'cjs',\n 'web.ts',\n 'ts',\n 'web.tsx',\n 'tsx',\n 'json',\n 'web.jsx',\n 'jsx',\n 'mdx',\n 'md',\n];\n\n// Source maps are resource heavy and can cause out of memory issue for large source files.\nconst shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';\n\nconst imageInlineSizeLimit = parseInt(process.env.IMAGE_INLINE_SIZE_LIMIT || '10000');\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 (isEnvProduction = false): Configuration {\n // Variable used for enabling profiling in Production\n // passed into alias object. Uses a flag if passed into the build command\n const isEnvProductionProfile = process.argv.includes('--profile');\n\n const baseStyleLoadersOptions = {\n injectingLoader: isEnvProduction ? MiniCssExtractPlugin.loader : styleLoaderPath,\n cssLoaderPath: require.resolve('css-loader'),\n postCssLoaderPath: require.resolve('postcss-loader'),\n postCssConfig,\n };\n\n // We will provide `paths.publicUrlOrPath` to our app\n // as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.\n // Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.\n // Get environment variables to inject into our app.\n // const env = getClientEnvironment(publicUrlOrPath.slice(0, -1));\n\n return {\n // TODO: make the dev tool according to shouldUseSourceMap and isEnvProduction\n // devtool: 'inline-source-map',\n resolve: {\n // These are the reasonable defaults supported by the Node ecosystem.\n // We also include JSX as a common component filename extension to support\n // some tools, although we do not recommend using it, see:\n // https://github.com/facebook/create-react-app/issues/290\n // `web` extension prefixes have been added for better support\n // for React Native Web.\n extensions: moduleFileExtensions.map((ext) => `.${ext}`),\n\n alias: {\n 'react/jsx-dev-runtime': require.resolve('react/jsx-dev-runtime.js'),\n 'react/jsx-runtime': require.resolve('react/jsx-runtime.js'),\n 'react-dom/server': require.resolve('react-dom/server'),\n // Allows for better profiling with ReactDevTools\n ...(isEnvProductionProfile && {\n 'react-dom$': 'react-dom/profiling',\n 'scheduler/tracing': 'scheduler/tracing-profiling',\n }),\n },\n },\n module: {\n strictExportPresence: true,\n rules: [\n {\n test: /\\.m?js/,\n resolve: {\n fullySpecified: false,\n },\n },\n {\n // \"oneOf\" will traverse all following loaders until one will\n // match the requirements. When no loader matches it will fall\n // back to the \"file\" loader at the end of the loader list.\n oneOf: [\n // \"postcss\" loader applies autoprefixer to our CSS.\n // \"css\" loader resolves paths in CSS and adds assets as dependencies.\n // \"style\" loader turns CSS into JS modules that inject <style> tags.\n // In production, we use MiniCSSExtractPlugin to extract that CSS\n // to a file, but in development \"style\" loader enables hot editing\n // of CSS.\n // By default we support CSS Modules with the extension .module.css\n {\n test: stylesRegexps.cssNoModulesRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n },\n })\n ),\n // Don't consider CSS imports dead code even if the\n // containing package claims to have no side effects.\n // Remove this when webpack adds a warning or an error for this.\n // See https://github.com/webpack/webpack/issues/6571\n sideEffects: true,\n },\n\n // Process application JS with Babel.\n // The preset includes JSX, Flow, TypeScript, and some ESnext features.\n {\n test: /\\.(js|mjs|jsx|ts|tsx)$/,\n exclude: [/node_modules/, /\\/dist\\//],\n // consider: limit loader to files only in a capsule that has bitid in package.json\n // descriptionData: { componentId: ComponentID.isValidObject },\n // // or\n // include: capsulePaths\n loader: require.resolve('babel-loader'),\n options: {\n babelrc: false,\n configFile: false,\n customize: require.resolve('babel-preset-react-app/webpack-overrides'),\n presets: [require.resolve('@babel/preset-react')],\n // This is a feature of `babel-loader` for webpack (not Babel itself).\n // It enables caching results in ./node_modules/.cache/babel-loader/\n // directory for faster rebuilds.\n cacheDirectory: true,\n // See #6846 for context on why cacheCompression is disabled\n cacheCompression: false,\n compact: isEnvProduction,\n },\n },\n // Process any JS outside of the app with Babel.\n // Unlike the application JS, we only compile the standard ES features.\n // Probably not needed in our use case\n // {\n // test: /\\.(js|mjs)$/,\n // exclude: /@babel(?:\\/|\\\\{1,2})runtime/,\n // loader: require.resolve('babel-loader'),\n // options: {\n // babelrc: false,\n // configFile: false,\n // compact: false,\n // presets: [[require.resolve('babel-preset-react-app/dependencies'), { helpers: true }]],\n // cacheDirectory: true,\n // // See #6846 for context on why cacheCompression is disabled\n // cacheCompression: false,\n\n // // Babel sourcemaps are needed for debugging into node_modules\n // // code. Without the options below, debuggers like VSCode\n // // show incorrect code and set breakpoints on the wrong lines.\n // sourceMaps: shouldUseSourceMap,\n // inputSourceMap: shouldUseSourceMap,\n // },\n // },\n // MDX support (move to the mdx aspect and extend from there)\n {\n test: /\\.mdx?$/,\n exclude: [/node_modules/],\n use: [\n {\n loader: require.resolve('babel-loader'),\n options: {\n babelrc: false,\n configFile: false,\n presets: [require.resolve('@babel/preset-react'), require.resolve('@babel/preset-env')],\n },\n },\n {\n loader: require.resolve('@teambit/mdx.modules.mdx-loader'),\n },\n ],\n },\n // Adds support for CSS Modules (https://github.com/css-modules/css-modules)\n // using the extension .module.css\n {\n test: stylesRegexps.cssModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n modules: {\n getLocalIdent: getCSSModuleLocalIdent,\n },\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n })\n ),\n },\n // Opt-in support for SASS (using .scss or .sass extensions).\n // By default we support SASS Modules with the\n // extensions .module.scss or .module.sass\n {\n test: stylesRegexps.sassNoModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 3,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('sass-loader'),\n },\n })\n ),\n // Don't consider CSS imports dead code even if the\n // containing package claims to have no side effects.\n // Remove this when webpack adds a warning or an error for this.\n // See https://github.com/webpack/webpack/issues/6571\n sideEffects: true,\n },\n // Adds support for CSS Modules, but using SASS\n // using the extension .module.scss or .module.sass\n {\n test: stylesRegexps.sassModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 3,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n modules: {\n getLocalIdent: getCSSModuleLocalIdent,\n },\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('sass-loader'),\n },\n })\n ),\n },\n {\n test: stylesRegexps.lessNoModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('less-loader'),\n },\n })\n ),\n // Don't consider CSS imports dead code even if the\n // containing package claims to have no side effects.\n // Remove this when webpack adds a warning or an error for this.\n // See https://github.com/webpack/webpack/issues/6571\n sideEffects: true,\n },\n {\n test: stylesRegexps.lessModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n modules: {\n getLocalIdent: getCSSModuleLocalIdent,\n },\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('less-loader'),\n },\n })\n ),\n },\n {\n test: [/\\.bmp$/, /\\.gif$/, /\\.jpe?g$/, /\\.png$/],\n type: 'asset',\n parser: {\n dataUrlCondition: {\n maxSize: imageInlineSizeLimit,\n },\n },\n generator: {\n filename: 'static/images/[hash][ext][query]',\n },\n },\n {\n // loads svg as both inlineUrl and react component, like:\n // import starUrl, { ReactComponent as StarIcon } from './star.svg';\n // (remove when there is native support for both opitons from webpack5 / svgr)\n test: /\\.svg$/,\n oneOf: [\n {\n dependency: { not: ['url'] }, // exclude new URL calls\n use: [\n {\n loader: require.resolve('@svgr/webpack'),\n options: { titleProp: true, ref: true },\n },\n require.resolve('new-url-loader'),\n ],\n },\n {\n type: 'asset', // export a data URI or emit a separate file\n },\n ],\n },\n {\n test: /\\.(woff(2)?|ttf|eot|svg)(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n type: 'asset',\n generator: {\n filename: 'static/fonts/[hash][ext][query]',\n },\n },\n\n // \"file\" loader makes sure those assets get served by WebpackDevServer.\n // When you `import` an asset, you get its (virtual) filename.\n // In production, they would get copied to the `build` folder.\n // This loader doesn't use a \"test\" so it will catch all modules\n // that fall through the other loaders.\n {\n // Exclude `js` files to keep \"css\" loader working as it injects\n // its runtime that would otherwise be processed through \"file\" loader.\n // Also exclude `html` and `json` extensions so they get processed\n // by webpacks internal loaders.\n exclude: [/\\.(js|mjs|cjs|jsx|ts|tsx)$/, /\\.html$/, /\\.mdx?/, /\\.json$/, /\\.css$/],\n generator: {\n filename: 'static/[hash][ext][query]',\n },\n type: 'asset',\n },\n // ** STOP ** Are you adding a new loader?\n // Make sure to add the new loader(s) before the \"type:asset\" loader.\n ],\n },\n ],\n },\n // @ts-ignore\n plugins: [\n isEnvProduction &&\n new MiniCssExtractPlugin({\n // Options similar to the same options in webpackOptions.output\n // both options are optional\n filename: 'static/css/[name].[contenthash:8].css',\n chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',\n }),\n // Moment.js is an extremely popular library that bundles large locale files\n // by default due to how webpack interprets its code. This is a practical\n // solution that requires the user to opt into importing specific locales.\n // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack\n // You can remove this if you don't use Moment.js:\n new IgnorePlugin({\n resourceRegExp: /^\\.\\/locale$/,\n contextRegExp: /moment$/,\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"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EA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CADG,EAKHrE,OAAO,CAACC,OAAR,CAAgB,gBAAhB,CALG;UAFP,CADK,EAWL;YACE2D,IAAI,EAAE,OADR,CACiB;;UADjB,CAXK;QALT,CA5MK,EAiOL;UACEhC,IAAI,EAAE,+CADR;UAEEgC,IAAI,EAAE,OAFR;UAGEI,SAAS,EAAE;YACTC,QAAQ,EAAE;UADD;QAHb,CAjOK,EAyOL;QACA;QACA;QACA;QACA;QACA;UACE;UACA;UACA;UACA;UACAzB,OAAO,EAAE,CAAC,4BAAD,EAA+B,SAA/B,EAA0C,QAA1C,EAAoD,SAApD,EAA+D,QAA/D,CALX;UAMEwB,SAAS,EAAE;YACTC,QAAQ,EAAE;UADD,CANb;UASEL,IAAI,EAAE;QATR,CA9OK,CAyPL;QACA;QA1PK;MAJT,CAPK;IAFD,CAvBH;IAmSL;IACAU,OAAO,EAAE,CACP5D,eAAe,IACb,KAAIM,+BAAJ,EAAyB;MACvB;MACA;MACAiD,QAAQ,EAAE,uCAHa;MAIvBM,aAAa,EAAE;IAJQ,CAAzB,CAFK,EAQP;IACA;IACA;IACA;IACA;IACA,KAAIC,uBAAJ,EAAiB;MACfC,cAAc,EAAE,cADD;MAEfC,aAAa,EAAE;IAFA,CAAjB,CAbO,EAiBPC,MAjBO,CAiBAC,OAjBA,CApSJ;IAsTL;IACA;IACAC,WAAW,EAAE;EAxTR,CAAP;AA0TD"}
|
|
1
|
+
{"version":3,"names":["styleLoaderPath","require","resolve","moduleFileExtensions","shouldUseSourceMap","process","env","GENERATE_SOURCEMAP","imageInlineSizeLimit","parseInt","IMAGE_INLINE_SIZE_LIMIT","isEnvProduction","isEnvProductionProfile","argv","includes","baseStyleLoadersOptions","injectingLoader","MiniCssExtractPlugin","loader","cssLoaderPath","postCssLoaderPath","postCssConfig","extensions","map","ext","alias","module","strictExportPresence","rules","test","fullySpecified","oneOf","stylesRegexps","cssNoModulesRegex","use","generateStyleLoaders","merge","cssLoaderOpts","importLoaders","sourceMap","sideEffects","exclude","options","babelrc","configFile","customize","presets","cacheDirectory","cacheCompression","compact","cssModuleRegex","modules","getLocalIdent","getCSSModuleLocalIdent","sassNoModuleRegex","preProcessOptions","resolveUrlLoaderPath","preProcessorPath","sassModuleRegex","lessNoModuleRegex","lessModuleRegex","type","parser","dataUrlCondition","maxSize","generator","filename","dependency","not","titleProp","ref","plugins","chunkFilename","IgnorePlugin","resourceRegExp","RegExp","sep","contextRegExp","filter","Boolean","performance"],"sources":["webpack.config.base.ts"],"sourcesContent":["import { merge } from 'lodash';\nimport { sep } from 'path';\nimport 'style-loader';\nimport MiniCssExtractPlugin from 'mini-css-extract-plugin';\nimport getCSSModuleLocalIdent from 'react-dev-utils/getCSSModuleLocalIdent';\nimport { Configuration, IgnorePlugin } from 'webpack';\nimport * as stylesRegexps from '@teambit/webpack.modules.style-regexps';\nimport { generateStyleLoaders } from '@teambit/webpack.modules.generate-style-loaders';\nimport { postCssConfig } from './postcss.config';\n// Make sure the bit-react-transformer is a dependency\n// TODO: remove it once we can set policy from component to component then set it via the component.json\nimport '@teambit/react.babel.bit-react-transformer';\n// Make sure the mdx-loader is a dependency\nimport '@teambit/mdx.modules.mdx-loader';\n\nconst styleLoaderPath = require.resolve('style-loader');\n\nconst moduleFileExtensions = [\n 'web.mjs',\n 'mjs',\n 'web.js',\n 'js',\n 'cjs',\n 'web.ts',\n 'ts',\n 'web.tsx',\n 'tsx',\n 'json',\n 'web.jsx',\n 'jsx',\n 'mdx',\n 'md',\n];\n\n// Source maps are resource heavy and can cause out of memory issue for large source files.\nconst shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';\n\nconst imageInlineSizeLimit = parseInt(process.env.IMAGE_INLINE_SIZE_LIMIT || '10000');\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 (isEnvProduction = false): Configuration {\n // Variable used for enabling profiling in Production\n // passed into alias object. Uses a flag if passed into the build command\n const isEnvProductionProfile = process.argv.includes('--profile');\n\n const baseStyleLoadersOptions = {\n injectingLoader: isEnvProduction ? MiniCssExtractPlugin.loader : styleLoaderPath,\n cssLoaderPath: require.resolve('css-loader'),\n postCssLoaderPath: require.resolve('postcss-loader'),\n postCssConfig,\n };\n\n // We will provide `paths.publicUrlOrPath` to our app\n // as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.\n // Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.\n // Get environment variables to inject into our app.\n // const env = getClientEnvironment(publicUrlOrPath.slice(0, -1));\n\n return {\n // TODO: make the dev tool according to shouldUseSourceMap and isEnvProduction\n // devtool: 'inline-source-map',\n resolve: {\n // These are the reasonable defaults supported by the Node ecosystem.\n // We also include JSX as a common component filename extension to support\n // some tools, although we do not recommend using it, see:\n // https://github.com/facebook/create-react-app/issues/290\n // `web` extension prefixes have been added for better support\n // for React Native Web.\n extensions: moduleFileExtensions.map((ext) => `.${ext}`),\n\n alias: {\n 'react/jsx-dev-runtime': require.resolve('react/jsx-dev-runtime.js'),\n 'react/jsx-runtime': require.resolve('react/jsx-runtime.js'),\n 'react-dom/server': require.resolve('react-dom/server'),\n // Allows for better profiling with ReactDevTools\n ...(isEnvProductionProfile && {\n 'react-dom$': 'react-dom/profiling',\n 'scheduler/tracing': 'scheduler/tracing-profiling',\n }),\n },\n },\n module: {\n strictExportPresence: true,\n rules: [\n {\n test: /\\.m?js/,\n resolve: {\n fullySpecified: false,\n },\n },\n {\n // \"oneOf\" will traverse all following loaders until one will\n // match the requirements. When no loader matches it will fall\n // back to the \"file\" loader at the end of the loader list.\n oneOf: [\n // \"postcss\" loader applies autoprefixer to our CSS.\n // \"css\" loader resolves paths in CSS and adds assets as dependencies.\n // \"style\" loader turns CSS into JS modules that inject <style> tags.\n // In production, we use MiniCSSExtractPlugin to extract that CSS\n // to a file, but in development \"style\" loader enables hot editing\n // of CSS.\n // By default we support CSS Modules with the extension .module.css\n {\n test: stylesRegexps.cssNoModulesRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n },\n })\n ),\n // Don't consider CSS imports dead code even if the\n // containing package claims to have no side effects.\n // Remove this when webpack adds a warning or an error for this.\n // See https://github.com/webpack/webpack/issues/6571\n sideEffects: true,\n },\n\n // Process application JS with Babel.\n // The preset includes JSX, Flow, TypeScript, and some ESnext features.\n {\n test: /\\.(js|mjs|jsx|ts|tsx)$/,\n exclude: [/node_modules/, /\\/dist\\//],\n // consider: limit loader to files only in a capsule that has bitid in package.json\n // descriptionData: { componentId: ComponentID.isValidObject },\n // // or\n // include: capsulePaths\n loader: require.resolve('babel-loader'),\n options: {\n babelrc: false,\n configFile: false,\n customize: require.resolve('babel-preset-react-app/webpack-overrides'),\n presets: [require.resolve('@babel/preset-react')],\n // This is a feature of `babel-loader` for webpack (not Babel itself).\n // It enables caching results in ./node_modules/.cache/babel-loader/\n // directory for faster rebuilds.\n cacheDirectory: true,\n // See #6846 for context on why cacheCompression is disabled\n cacheCompression: false,\n compact: isEnvProduction,\n },\n },\n // Process any JS outside of the app with Babel.\n // Unlike the application JS, we only compile the standard ES features.\n // Probably not needed in our use case\n // {\n // test: /\\.(js|mjs)$/,\n // exclude: /@babel(?:\\/|\\\\{1,2})runtime/,\n // loader: require.resolve('babel-loader'),\n // options: {\n // babelrc: false,\n // configFile: false,\n // compact: false,\n // presets: [[require.resolve('babel-preset-react-app/dependencies'), { helpers: true }]],\n // cacheDirectory: true,\n // // See #6846 for context on why cacheCompression is disabled\n // cacheCompression: false,\n\n // // Babel sourcemaps are needed for debugging into node_modules\n // // code. Without the options below, debuggers like VSCode\n // // show incorrect code and set breakpoints on the wrong lines.\n // sourceMaps: shouldUseSourceMap,\n // inputSourceMap: shouldUseSourceMap,\n // },\n // },\n // MDX support (move to the mdx aspect and extend from there)\n {\n test: /\\.mdx?$/,\n exclude: [/node_modules/],\n use: [\n {\n loader: require.resolve('babel-loader'),\n options: {\n babelrc: false,\n configFile: false,\n presets: [require.resolve('@babel/preset-react'), require.resolve('@babel/preset-env')],\n },\n },\n {\n loader: require.resolve('@teambit/mdx.modules.mdx-loader'),\n },\n ],\n },\n // Adds support for CSS Modules (https://github.com/css-modules/css-modules)\n // using the extension .module.css\n {\n test: stylesRegexps.cssModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n modules: {\n getLocalIdent: getCSSModuleLocalIdent,\n },\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n })\n ),\n },\n // Opt-in support for SASS (using .scss or .sass extensions).\n // By default we support SASS Modules with the\n // extensions .module.scss or .module.sass\n {\n test: stylesRegexps.sassNoModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 3,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('sass-loader'),\n },\n })\n ),\n // Don't consider CSS imports dead code even if the\n // containing package claims to have no side effects.\n // Remove this when webpack adds a warning or an error for this.\n // See https://github.com/webpack/webpack/issues/6571\n sideEffects: true,\n },\n // Adds support for CSS Modules, but using SASS\n // using the extension .module.scss or .module.sass\n {\n test: stylesRegexps.sassModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 3,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n modules: {\n getLocalIdent: getCSSModuleLocalIdent,\n },\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('sass-loader'),\n },\n })\n ),\n },\n {\n test: stylesRegexps.lessNoModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('less-loader'),\n },\n })\n ),\n // Don't consider CSS imports dead code even if the\n // containing package claims to have no side effects.\n // Remove this when webpack adds a warning or an error for this.\n // See https://github.com/webpack/webpack/issues/6571\n sideEffects: true,\n },\n {\n test: stylesRegexps.lessModuleRegex,\n use: generateStyleLoaders(\n merge({}, baseStyleLoadersOptions, {\n cssLoaderOpts: {\n importLoaders: 1,\n sourceMap: isEnvProduction || shouldUseSourceMap,\n modules: {\n getLocalIdent: getCSSModuleLocalIdent,\n },\n },\n shouldUseSourceMap: isEnvProduction || shouldUseSourceMap,\n preProcessOptions: {\n resolveUrlLoaderPath: require.resolve('resolve-url-loader'),\n preProcessorPath: require.resolve('less-loader'),\n },\n })\n ),\n },\n {\n test: [/\\.bmp$/, /\\.gif$/, /\\.jpe?g$/, /\\.png$/],\n type: 'asset',\n parser: {\n dataUrlCondition: {\n maxSize: imageInlineSizeLimit,\n },\n },\n generator: {\n filename: 'static/images/[hash][ext][query]',\n },\n },\n {\n // loads svg as both inlineUrl and react component, like:\n // import starUrl, { ReactComponent as StarIcon } from './star.svg';\n // (remove when there is native support for both opitons from webpack5 / svgr)\n test: /\\.svg$/,\n oneOf: [\n {\n dependency: { not: ['url'] }, // exclude new URL calls\n use: [\n {\n loader: require.resolve('@svgr/webpack'),\n options: { titleProp: true, ref: true },\n },\n require.resolve('new-url-loader'),\n ],\n },\n {\n type: 'asset', // export a data URI or emit a separate file\n },\n ],\n },\n {\n test: /\\.(woff(2)?|ttf|eot|svg)(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n type: 'asset',\n generator: {\n filename: 'static/fonts/[hash][ext][query]',\n },\n },\n\n // \"file\" loader makes sure those assets get served by WebpackDevServer.\n // When you `import` an asset, you get its (virtual) filename.\n // In production, they would get copied to the `build` folder.\n // This loader doesn't use a \"test\" so it will catch all modules\n // that fall through the other loaders.\n {\n // Exclude `js` files to keep \"css\" loader working as it injects\n // its runtime that would otherwise be processed through \"file\" loader.\n // Also exclude `html` and `json` extensions so they get processed\n // by webpacks internal loaders.\n exclude: [/\\.(js|mjs|cjs|jsx|ts|tsx)$/, /\\.html$/, /\\.mdx?/, /\\.json$/, /\\.css$/],\n generator: {\n filename: 'static/[hash][ext][query]',\n },\n type: 'asset',\n },\n // ** STOP ** Are you adding a new loader?\n // Make sure to add the new loader(s) before the \"type:asset\" loader.\n ],\n },\n ],\n },\n // @ts-ignore\n plugins: [\n isEnvProduction &&\n new MiniCssExtractPlugin({\n // Options similar to the same options in webpackOptions.output\n // both options are optional\n filename: 'static/css/[name].[contenthash:8].css',\n chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',\n }),\n // Moment.js is an extremely popular library that bundles large locale files\n // by default due to how webpack interprets its code. This is a practical\n // solution that requires the user to opt into importing specific locales.\n // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack\n // You can remove this if you don't use Moment.js:\n new IgnorePlugin({\n resourceRegExp: new RegExp(`^\\\\.${sep}locale$`),\n contextRegExp: /moment$/,\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;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