@teambit/react 0.0.880 → 0.0.882
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/artifacts/__bit_junit.xml +2 -2
- package/artifacts/env-template/public/{770.8cc321d531369e25ec1c.js → 700.fcb0085dcdf160cc65c9.js} +18 -20
- package/artifacts/env-template/public/assets-manifest.json +16 -16
- package/artifacts/env-template/public/{compositions.aab650d15edcf055899a.js → compositions.d36450c5ae70173e7a70.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.5ef8ce1624e4c34dadf2.js → overview.ca1695b4bf4d507d7a28.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/peers.9642cecf0c09b9d93f54.js +1 -0
- package/artifacts/env-template/public/{preview-root.48c79384da92a8a7a512.js → preview-root.a829360e0cc95e341dfd.js} +1 -1
- package/artifacts/env-template/public/static/css/700.bd8655a5.css +1 -0
- package/artifacts/env-template/public/static/css/compositions.e163efe5.css +1 -0
- package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css} +1 -1
- package/artifacts/preview/teambit_react_react-preview.js +1 -1
- package/{compositions-1666312873430.js → compositions-1666496165706.js} +0 -0
- package/dist/apps/web/compute-results.js +0 -2
- package/dist/apps/web/compute-results.js.map +1 -1
- package/dist/apps/web/index.js +0 -3
- package/dist/apps/web/index.js.map +1 -1
- package/dist/apps/web/plugins/index.js +0 -3
- package/dist/apps/web/plugins/index.js.map +1 -1
- package/dist/apps/web/plugins/prerender.js +0 -14
- package/dist/apps/web/plugins/prerender.js.map +1 -1
- package/dist/apps/web/react.app-type.js +0 -7
- package/dist/apps/web/react.app-type.js.map +1 -1
- package/dist/apps/web/react.application.js +11 -76
- package/dist/apps/web/react.application.js.map +1 -1
- package/dist/apps/web/ssr/ssr-express.js +0 -31
- package/dist/apps/web/ssr/ssr-express.js.map +1 -1
- package/dist/apps/web/webpack/mutators.js +0 -13
- package/dist/apps/web/webpack/mutators.js.map +1 -1
- package/dist/apps/web/webpack/webpack.app.ssr.config.js +0 -11
- package/dist/apps/web/webpack/webpack.app.ssr.config.js.map +1 -1
- package/dist/eslint/eslintrc.js +1 -1
- package/dist/eslint/eslintrc.js.map +1 -1
- package/dist/highlighter-widget.js +0 -16
- package/dist/highlighter-widget.js.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/jest/index.js +0 -7
- package/dist/jest/index.js.map +1 -1
- package/dist/jest/jest.base.config.js +3 -3
- package/dist/jest/jest.base.config.js.map +1 -1
- package/dist/jest/jest.cjs.config.js +0 -10
- package/dist/jest/jest.cjs.config.js.map +1 -1
- package/dist/jest/jest.config.js +1 -1
- package/dist/jest/jest.config.js.map +1 -1
- package/dist/jest/jest.esm.config.js +0 -10
- package/dist/jest/jest.esm.config.js.map +1 -1
- package/dist/jest/setupTests.js.map +1 -1
- package/dist/jest/transformers/base-transformer-plugins.js +1 -0
- package/dist/jest/transformers/base-transformer-plugins.js.map +1 -1
- package/dist/jest/transformers/base-transformer-presets.js +1 -0
- package/dist/jest/transformers/base-transformer-presets.js.map +1 -1
- package/dist/jest/transformers/base-transformer-process.js +0 -2
- package/dist/jest/transformers/base-transformer-process.js.map +1 -1
- package/dist/jest/transformers/cjs-transformer.js +0 -5
- package/dist/jest/transformers/cjs-transformer.js.map +1 -1
- package/dist/jest/transformers/css-transform.js +1 -2
- package/dist/jest/transformers/css-transform.js.map +1 -1
- package/dist/jest/transformers/esm-transformer.js +1 -5
- package/dist/jest/transformers/esm-transformer.js.map +1 -1
- package/dist/jest/transformers/file-transform.js +2 -6
- package/dist/jest/transformers/file-transform.js.map +1 -1
- package/dist/prettier/prettier.config.js.map +1 -1
- package/dist/react.aspect.js +0 -5
- package/dist/react.aspect.js.map +1 -1
- package/dist/react.composition.js +0 -6
- package/dist/react.composition.js.map +1 -1
- package/dist/react.env.js +34 -143
- package/dist/react.env.js.map +1 -1
- package/dist/react.graphql.js +0 -6
- package/dist/react.graphql.js.map +1 -1
- package/dist/react.main.runtime.js +23 -152
- package/dist/react.main.runtime.js.map +1 -1
- package/dist/react.preview.runtime.js +0 -32
- package/dist/react.preview.runtime.js.map +1 -1
- package/dist/react.templates.js +0 -46
- package/dist/react.templates.js.map +1 -1
- package/dist/react.ui.runtime.js +0 -35
- package/dist/react.ui.runtime.js.map +1 -1
- package/dist/templates/react-app/files/app-plugin.js +0 -1
- package/dist/templates/react-app/files/app-plugin.js.map +1 -1
- package/dist/templates/react-app/files/app-root.js +0 -1
- package/dist/templates/react-app/files/app-root.js.map +1 -1
- package/dist/templates/react-app/files/app.js +0 -1
- package/dist/templates/react-app/files/app.js.map +1 -1
- package/dist/templates/react-app/files/compositions.js +0 -1
- package/dist/templates/react-app/files/compositions.js.map +1 -1
- package/dist/templates/react-app/files/doc.js +0 -1
- package/dist/templates/react-app/files/doc.js.map +1 -1
- package/dist/templates/react-app/files/index.js +0 -1
- package/dist/templates/react-app/files/index.js.map +1 -1
- package/dist/templates/react-app/index.js +0 -19
- package/dist/templates/react-app/index.js.map +1 -1
- package/dist/templates/react-component/files/component.js +0 -2
- package/dist/templates/react-component/files/component.js.map +1 -1
- package/dist/templates/react-component/files/composition.js +0 -2
- package/dist/templates/react-component/files/composition.js.map +1 -1
- package/dist/templates/react-component/files/docs.js +0 -2
- package/dist/templates/react-component/files/docs.js.map +1 -1
- package/dist/templates/react-component/files/index-file.js +0 -2
- package/dist/templates/react-component/files/index-file.js.map +1 -1
- package/dist/templates/react-component/files/test.js +0 -2
- package/dist/templates/react-component/files/test.js.map +1 -1
- package/dist/templates/react-component/index.js +0 -24
- package/dist/templates/react-component/index.js.map +1 -1
- package/dist/templates/react-component-js/files/component.js +0 -2
- package/dist/templates/react-component-js/files/component.js.map +1 -1
- package/dist/templates/react-component-js/files/composition.js +0 -2
- package/dist/templates/react-component-js/files/composition.js.map +1 -1
- package/dist/templates/react-component-js/files/docs.js +0 -2
- package/dist/templates/react-component-js/files/docs.js.map +1 -1
- package/dist/templates/react-component-js/files/test.js +0 -2
- package/dist/templates/react-component-js/files/test.js.map +1 -1
- package/dist/templates/react-component-js/index.js +0 -21
- package/dist/templates/react-component-js/index.js.map +1 -1
- package/dist/templates/react-context/files/composition.js +0 -2
- package/dist/templates/react-context/files/composition.js.map +1 -1
- package/dist/templates/react-context/files/context-provider.js +0 -2
- package/dist/templates/react-context/files/context-provider.js.map +1 -1
- package/dist/templates/react-context/files/context.js +0 -2
- package/dist/templates/react-context/files/context.js.map +1 -1
- package/dist/templates/react-context/files/docs.js +0 -2
- package/dist/templates/react-context/files/docs.js.map +1 -1
- package/dist/templates/react-context/files/index-file.js +0 -2
- package/dist/templates/react-context/files/index-file.js.map +1 -1
- package/dist/templates/react-context/files/test.js +0 -2
- package/dist/templates/react-context/files/test.js.map +1 -1
- package/dist/templates/react-context/index.js +0 -19
- package/dist/templates/react-context/index.js.map +1 -1
- package/dist/templates/react-env/files/aspect.js +0 -1
- package/dist/templates/react-env/files/aspect.js.map +1 -1
- package/dist/templates/react-env/files/doc.js +0 -1
- package/dist/templates/react-env/files/doc.js.map +1 -1
- package/dist/templates/react-env/files/index.js +0 -1
- package/dist/templates/react-env/files/index.js.map +1 -1
- package/dist/templates/react-env/files/jest.config.js +0 -1
- package/dist/templates/react-env/files/jest.config.js.map +1 -1
- package/dist/templates/react-env/files/main.runtime.js +0 -1
- package/dist/templates/react-env/files/main.runtime.js.map +1 -1
- package/dist/templates/react-env/files/preview.runtime.js +0 -1
- package/dist/templates/react-env/files/preview.runtime.js.map +1 -1
- package/dist/templates/react-env/files/typescript/styles.js +0 -1
- package/dist/templates/react-env/files/typescript/styles.js.map +1 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.js +0 -1
- package/dist/templates/react-env/files/typescript/ts-transformer.js.map +1 -1
- package/dist/templates/react-env/files/typescript/typescript.config.js +0 -1
- package/dist/templates/react-env/files/typescript/typescript.config.js.map +1 -1
- package/dist/templates/react-env/files/webpack.config.js +0 -1
- package/dist/templates/react-env/files/webpack.config.js.map +1 -1
- package/dist/templates/react-env/index.js +0 -31
- package/dist/templates/react-env/index.js.map +1 -1
- package/dist/templates/react-hook/files/component.js +0 -2
- package/dist/templates/react-hook/files/component.js.map +1 -1
- package/dist/templates/react-hook/files/composition.js +0 -2
- package/dist/templates/react-hook/files/composition.js.map +1 -1
- package/dist/templates/react-hook/files/docs.js +0 -2
- package/dist/templates/react-hook/files/docs.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.js +0 -2
- package/dist/templates/react-hook/files/index-file.js.map +1 -1
- package/dist/templates/react-hook/files/index-file.spec.js +0 -6
- package/dist/templates/react-hook/files/index-file.spec.js.map +1 -1
- package/dist/templates/react-hook/files/test.js +0 -2
- package/dist/templates/react-hook/files/test.js.map +1 -1
- package/dist/templates/react-hook/index.js +0 -16
- package/dist/templates/react-hook/index.js.map +1 -1
- package/dist/templates/react-workspace/index.js +2 -6
- package/dist/templates/react-workspace/index.js.map +1 -1
- package/dist/templates/react-workspace-analytics/index.js +0 -5
- package/dist/templates/react-workspace-analytics/index.js.map +1 -1
- package/dist/templates/react-workspace-app/index.js +2 -13
- package/dist/templates/react-workspace-app/index.js.map +1 -1
- package/dist/templates/react-workspace-blog/index.js +0 -5
- package/dist/templates/react-workspace-blog/index.js.map +1 -1
- package/dist/templates/react-workspace-data-fetching/index.js +0 -5
- package/dist/templates/react-workspace-data-fetching/index.js.map +1 -1
- package/dist/templates/react-workspace-deprecated/index.js +0 -5
- package/dist/templates/react-workspace-deprecated/index.js.map +1 -1
- package/dist/templates/react-workspace-design-system/index.js +0 -5
- package/dist/templates/react-workspace-design-system/index.js.map +1 -1
- package/dist/templates/react-workspace-lib/index.js +0 -5
- package/dist/templates/react-workspace-lib/index.js.map +1 -1
- package/dist/templates/react-workspace-wiki/index.js +0 -5
- package/dist/templates/react-workspace-wiki/index.js.map +1 -1
- package/dist/templates/workspace-common/constants.js.map +1 -1
- package/dist/templates/workspace-common/files/eslint-config.js.map +1 -1
- package/dist/templates/workspace-common/files/git-ignore.js +0 -1
- package/dist/templates/workspace-common/files/git-ignore.js.map +1 -1
- package/dist/templates/workspace-common/files/launch-json.js +0 -2
- package/dist/templates/workspace-common/files/launch-json.js.map +1 -1
- package/dist/templates/workspace-common/files/prettier-config.js.map +1 -1
- package/dist/templates/workspace-common/files/readme-file.js +0 -1
- package/dist/templates/workspace-common/files/readme-file.js.map +1 -1
- package/dist/templates/workspace-common/files/ts-config.js.map +1 -1
- package/dist/templates/workspace-common/files/types/asset.js.map +1 -1
- package/dist/templates/workspace-common/files/types/style.js.map +1 -1
- package/dist/templates/workspace-common/files/workspace-config.js +0 -14
- package/dist/templates/workspace-common/files/workspace-config.js.map +1 -1
- package/dist/templates/workspace-common/generate-files.js +0 -29
- package/dist/templates/workspace-common/generate-files.js.map +1 -1
- package/dist/templates/workspace-common/index.js +0 -3
- package/dist/templates/workspace-common/index.js.map +1 -1
- package/dist/webpack/html.js +3 -2
- package/dist/webpack/html.js.map +1 -1
- package/dist/webpack/index.js +0 -3
- package/dist/webpack/index.js.map +1 -1
- package/dist/webpack/overlay/formatWebpackMessages.js +26 -37
- package/dist/webpack/overlay/formatWebpackMessages.js.map +1 -1
- package/dist/webpack/overlay/launchEditorEndpoint.js +2 -2
- package/dist/webpack/overlay/launchEditorEndpoint.js.map +1 -1
- package/dist/webpack/overlay/refreshOverlayInterop.js +1 -3
- package/dist/webpack/overlay/refreshOverlayInterop.js.map +1 -1
- package/dist/webpack/overlay/webpackHotDevClient.js +54 -71
- package/dist/webpack/overlay/webpackHotDevClient.js.map +1 -1
- package/dist/webpack/postcss.config.js +6 -3
- package/dist/webpack/postcss.config.js.map +1 -1
- package/dist/webpack/webpack.config.base.js +28 -53
- package/dist/webpack/webpack.config.base.js.map +1 -1
- package/dist/webpack/webpack.config.base.prod.js +10 -14
- package/dist/webpack/webpack.config.base.prod.js.map +1 -1
- package/dist/webpack/webpack.config.component.dev.js +10 -17
- package/dist/webpack/webpack.config.component.dev.js.map +1 -1
- package/dist/webpack/webpack.config.component.prod.js +3 -6
- package/dist/webpack/webpack.config.component.prod.js.map +1 -1
- package/dist/webpack/webpack.config.env.dev.js +5 -5
- package/dist/webpack/webpack.config.env.dev.js.map +1 -1
- package/dist/webpack/webpack.config.env.template.js +0 -1
- package/dist/webpack/webpack.config.env.template.js.map +1 -1
- package/{overview-1666312873430.js → overview-1666496165706.js} +0 -0
- package/package-tar/teambit-react-0.0.882.tgz +0 -0
- package/package.json +30 -30
- package/{preview-1666312873430.js → preview-1666496165706.js} +2 -2
- package/artifacts/env-template/public/peers.d8a0e658db2c8c4cd6c0.js +0 -1
- package/artifacts/env-template/public/static/css/770.a0238c25.css +0 -1
- package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
- package/package-tar/teambit-react-0.0.880.tgz +0 -0
|
@@ -1,129 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.regexp.constructor.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.regexp.exec.js");
|
|
8
|
-
|
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
9
|
exports.default = _default;
|
|
13
|
-
|
|
14
10
|
function _defineProperty2() {
|
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
12
|
_defineProperty2 = function () {
|
|
18
13
|
return data;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
15
|
return data;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
function _lodash() {
|
|
25
18
|
const data = require("lodash");
|
|
26
|
-
|
|
27
19
|
_lodash = function () {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
return data;
|
|
32
23
|
}
|
|
33
|
-
|
|
34
24
|
function _path() {
|
|
35
25
|
const data = require("path");
|
|
36
|
-
|
|
37
26
|
_path = function () {
|
|
38
27
|
return data;
|
|
39
28
|
};
|
|
40
|
-
|
|
41
29
|
return data;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
require("style-loader");
|
|
45
|
-
|
|
46
32
|
function _miniCssExtractPlugin() {
|
|
47
33
|
const data = _interopRequireDefault(require("mini-css-extract-plugin"));
|
|
48
|
-
|
|
49
34
|
_miniCssExtractPlugin = function () {
|
|
50
35
|
return data;
|
|
51
36
|
};
|
|
52
|
-
|
|
53
37
|
return data;
|
|
54
38
|
}
|
|
55
|
-
|
|
56
39
|
function _getCSSModuleLocalIdent() {
|
|
57
40
|
const data = _interopRequireDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
|
|
58
|
-
|
|
59
41
|
_getCSSModuleLocalIdent = function () {
|
|
60
42
|
return data;
|
|
61
43
|
};
|
|
62
|
-
|
|
63
44
|
return data;
|
|
64
45
|
}
|
|
65
|
-
|
|
66
46
|
function _webpack() {
|
|
67
47
|
const data = require("webpack");
|
|
68
|
-
|
|
69
48
|
_webpack = function () {
|
|
70
49
|
return data;
|
|
71
50
|
};
|
|
72
|
-
|
|
73
51
|
return data;
|
|
74
52
|
}
|
|
75
|
-
|
|
76
53
|
function stylesRegexps() {
|
|
77
54
|
const data = _interopRequireWildcard(require("@teambit/webpack.modules.style-regexps"));
|
|
78
|
-
|
|
79
55
|
stylesRegexps = function () {
|
|
80
56
|
return data;
|
|
81
57
|
};
|
|
82
|
-
|
|
83
58
|
return data;
|
|
84
59
|
}
|
|
85
|
-
|
|
86
60
|
function _webpackModules2() {
|
|
87
61
|
const data = require("@teambit/webpack.modules.generate-style-loaders");
|
|
88
|
-
|
|
89
62
|
_webpackModules2 = function () {
|
|
90
63
|
return data;
|
|
91
64
|
};
|
|
92
|
-
|
|
93
65
|
return data;
|
|
94
66
|
}
|
|
95
|
-
|
|
96
67
|
function _postcss() {
|
|
97
68
|
const data = require("./postcss.config");
|
|
98
|
-
|
|
99
69
|
_postcss = function () {
|
|
100
70
|
return data;
|
|
101
71
|
};
|
|
102
|
-
|
|
103
72
|
return data;
|
|
104
73
|
}
|
|
105
|
-
|
|
106
74
|
require("@teambit/react.babel.bit-react-transformer");
|
|
107
|
-
|
|
108
75
|
require("@teambit/mdx.modules.mdx-loader");
|
|
109
|
-
|
|
110
76
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
111
|
-
|
|
112
77
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
113
|
-
|
|
114
78
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
115
|
-
|
|
116
79
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
117
|
-
|
|
118
80
|
const styleLoaderPath = require.resolve('style-loader');
|
|
81
|
+
const moduleFileExtensions = ['web.mjs', 'mjs', 'web.js', 'js', 'cjs', 'web.ts', 'ts', 'web.tsx', 'tsx', 'json', 'web.jsx', 'jsx', 'mdx', 'md'];
|
|
119
82
|
|
|
120
|
-
|
|
121
|
-
|
|
83
|
+
// Source maps are resource heavy and can cause out of memory issue for large source files.
|
|
122
84
|
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
|
|
123
|
-
const imageInlineSizeLimit = parseInt(process.env.IMAGE_INLINE_SIZE_LIMIT || '10000');
|
|
85
|
+
const imageInlineSizeLimit = parseInt(process.env.IMAGE_INLINE_SIZE_LIMIT || '10000');
|
|
86
|
+
|
|
87
|
+
// This is the production and development configuration.
|
|
124
88
|
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
|
|
125
89
|
// eslint-disable-next-line complexity
|
|
126
|
-
|
|
127
90
|
function _default(isEnvProduction = false) {
|
|
128
91
|
// Variable used for enabling profiling in Production
|
|
129
92
|
// passed into alias object. Uses a flag if passed into the build command
|
|
@@ -133,7 +96,9 @@ function _default(isEnvProduction = false) {
|
|
|
133
96
|
cssLoaderPath: require.resolve('css-loader'),
|
|
134
97
|
postCssLoaderPath: require.resolve('postcss-loader'),
|
|
135
98
|
postCssConfig: _postcss().postCssConfig
|
|
136
|
-
};
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// We will provide `paths.publicUrlOrPath` to our app
|
|
137
102
|
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
|
|
138
103
|
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
|
|
139
104
|
// Get environment variables to inject into our app.
|
|
@@ -170,7 +135,8 @@ function _default(isEnvProduction = false) {
|
|
|
170
135
|
// "oneOf" will traverse all following loaders until one will
|
|
171
136
|
// match the requirements. When no loader matches it will fall
|
|
172
137
|
// back to the "file" loader at the end of the loader list.
|
|
173
|
-
oneOf: [
|
|
138
|
+
oneOf: [
|
|
139
|
+
// "postcss" loader applies autoprefixer to our CSS.
|
|
174
140
|
// "css" loader resolves paths in CSS and adds assets as dependencies.
|
|
175
141
|
// "style" loader turns CSS into JS modules that inject <style> tags.
|
|
176
142
|
// In production, we use MiniCSSExtractPlugin to extract that CSS
|
|
@@ -190,7 +156,8 @@ function _default(isEnvProduction = false) {
|
|
|
190
156
|
// Remove this when webpack adds a warning or an error for this.
|
|
191
157
|
// See https://github.com/webpack/webpack/issues/6571
|
|
192
158
|
sideEffects: true
|
|
193
|
-
},
|
|
159
|
+
},
|
|
160
|
+
// Process application JS with Babel.
|
|
194
161
|
// The preset includes JSX, Flow, TypeScript, and some ESnext features.
|
|
195
162
|
{
|
|
196
163
|
test: /\.(js|mjs|jsx|ts|tsx)$/,
|
|
@@ -213,7 +180,8 @@ function _default(isEnvProduction = false) {
|
|
|
213
180
|
cacheCompression: false,
|
|
214
181
|
compact: isEnvProduction
|
|
215
182
|
}
|
|
216
|
-
},
|
|
183
|
+
},
|
|
184
|
+
// Process any JS outside of the app with Babel.
|
|
217
185
|
// Unlike the application JS, we only compile the standard ES features.
|
|
218
186
|
// Probably not needed in our use case
|
|
219
187
|
// {
|
|
@@ -228,6 +196,7 @@ function _default(isEnvProduction = false) {
|
|
|
228
196
|
// cacheDirectory: true,
|
|
229
197
|
// // See #6846 for context on why cacheCompression is disabled
|
|
230
198
|
// cacheCompression: false,
|
|
199
|
+
|
|
231
200
|
// // Babel sourcemaps are needed for debugging into node_modules
|
|
232
201
|
// // code. Without the options below, debuggers like VSCode
|
|
233
202
|
// // show incorrect code and set breakpoints on the wrong lines.
|
|
@@ -249,7 +218,8 @@ function _default(isEnvProduction = false) {
|
|
|
249
218
|
}, {
|
|
250
219
|
loader: require.resolve('@teambit/mdx.modules.mdx-loader')
|
|
251
220
|
}]
|
|
252
|
-
},
|
|
221
|
+
},
|
|
222
|
+
// Adds support for CSS Modules (https://github.com/css-modules/css-modules)
|
|
253
223
|
// using the extension .module.css
|
|
254
224
|
{
|
|
255
225
|
test: stylesRegexps().cssModuleRegex,
|
|
@@ -263,7 +233,8 @@ function _default(isEnvProduction = false) {
|
|
|
263
233
|
},
|
|
264
234
|
shouldUseSourceMap: isEnvProduction || shouldUseSourceMap
|
|
265
235
|
}))
|
|
266
|
-
},
|
|
236
|
+
},
|
|
237
|
+
// Opt-in support for SASS (using .scss or .sass extensions).
|
|
267
238
|
// By default we support SASS Modules with the
|
|
268
239
|
// extensions .module.scss or .module.sass
|
|
269
240
|
{
|
|
@@ -284,7 +255,8 @@ function _default(isEnvProduction = false) {
|
|
|
284
255
|
// Remove this when webpack adds a warning or an error for this.
|
|
285
256
|
// See https://github.com/webpack/webpack/issues/6571
|
|
286
257
|
sideEffects: true
|
|
287
|
-
},
|
|
258
|
+
},
|
|
259
|
+
// Adds support for CSS Modules, but using SASS
|
|
288
260
|
// using the extension .module.scss or .module.sass
|
|
289
261
|
{
|
|
290
262
|
test: stylesRegexps().sassModuleRegex,
|
|
@@ -366,7 +338,6 @@ function _default(isEnvProduction = false) {
|
|
|
366
338
|
}, require.resolve('new-url-loader')]
|
|
367
339
|
}, {
|
|
368
340
|
type: 'asset' // export a data URI or emit a separate file
|
|
369
|
-
|
|
370
341
|
}]
|
|
371
342
|
}, {
|
|
372
343
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
@@ -374,7 +345,8 @@ function _default(isEnvProduction = false) {
|
|
|
374
345
|
generator: {
|
|
375
346
|
filename: 'static/fonts/[hash][ext][query]'
|
|
376
347
|
}
|
|
377
|
-
},
|
|
348
|
+
},
|
|
349
|
+
// "file" loader makes sure those assets get served by WebpackDevServer.
|
|
378
350
|
// When you `import` an asset, you get its (virtual) filename.
|
|
379
351
|
// In production, they would get copied to the `build` folder.
|
|
380
352
|
// This loader doesn't use a "test" so it will catch all modules
|
|
@@ -389,18 +361,21 @@ function _default(isEnvProduction = false) {
|
|
|
389
361
|
filename: 'static/[hash][ext][query]'
|
|
390
362
|
},
|
|
391
363
|
type: 'asset'
|
|
392
|
-
}
|
|
364
|
+
}
|
|
365
|
+
// ** STOP ** Are you adding a new loader?
|
|
393
366
|
// Make sure to add the new loader(s) before the "type:asset" loader.
|
|
394
367
|
]
|
|
395
368
|
}]
|
|
396
369
|
},
|
|
370
|
+
|
|
397
371
|
// @ts-ignore
|
|
398
372
|
plugins: [isEnvProduction && new (_miniCssExtractPlugin().default)({
|
|
399
373
|
// Options similar to the same options in webpackOptions.output
|
|
400
374
|
// both options are optional
|
|
401
375
|
filename: 'static/css/[name].[contenthash:8].css',
|
|
402
376
|
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css'
|
|
403
|
-
}),
|
|
377
|
+
}),
|
|
378
|
+
// Moment.js is an extremely popular library that bundles large locale files
|
|
404
379
|
// by default due to how webpack interprets its code. This is a practical
|
|
405
380
|
// solution that requires the user to opt into importing specific locales.
|
|
406
381
|
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
|
|
@@ -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","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;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAA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;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,IAAIC,MAAJ,CAAY,OAAMC,WAAI,SAAtB,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;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;AAEA;AAAyC;AAAA;AAAA;AAAA;AAEzC,MAAMA,eAAe,GAAGC,OAAO,CAACC,OAAO,CAAC,cAAc,CAAC;AAEvD,MAAMC,oBAAoB,GAAG,CAC3B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,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MACvB;MACA;MACAiD,QAAQ,EAAE,uCAAuC;MACjDM,aAAa,EAAE;IACjB,CAAC,CAAC;IACJ;IACA;IACA;IACA;IACA;IACA,KAAIC,uBAAY,EAAC;MACfC,cAAc,EAAE,IAAIC,MAAM,CAAE,OAAMC,WAAI,SAAQ,CAAC;MAC/CC,aAAa,EAAE;IACjB,CAAC,CAAC,CACH,CAACC,MAAM,CAACC,OAAO,CAAC;IACjB;IACA;IACAC,WAAW,EAAE;EACf,CAAC;AACH"}
|
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = _default;
|
|
9
|
-
|
|
10
8
|
function _cssMinimizerWebpackPlugin() {
|
|
11
9
|
const data = _interopRequireDefault(require("css-minimizer-webpack-plugin"));
|
|
12
|
-
|
|
13
10
|
_cssMinimizerWebpackPlugin = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _terserWebpackPlugin() {
|
|
21
16
|
const data = _interopRequireDefault(require("terser-webpack-plugin"));
|
|
22
|
-
|
|
23
17
|
_terserWebpackPlugin = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
// import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
|
|
23
|
+
|
|
31
24
|
// This is the production and development configuration.
|
|
32
25
|
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
|
|
33
26
|
// eslint-disable-next-line complexity
|
|
@@ -46,9 +39,10 @@ function _default(dev) {
|
|
|
46
39
|
minifyIdentifiers: false,
|
|
47
40
|
// minifyIdentifiers: true,
|
|
48
41
|
minifySyntax: true
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}),
|
|
42
|
+
}
|
|
43
|
+
// terserOptions: {},
|
|
44
|
+
}),
|
|
45
|
+
// This is only used in production mode
|
|
52
46
|
// new TerserPlugin({
|
|
53
47
|
// extractComments: false,
|
|
54
48
|
// terserOptions: {
|
|
@@ -94,7 +88,8 @@ function _default(dev) {
|
|
|
94
88
|
}
|
|
95
89
|
}]
|
|
96
90
|
}
|
|
97
|
-
})]
|
|
91
|
+
})]
|
|
92
|
+
// Automatically split vendor and commons
|
|
98
93
|
// https://twitter.com/wSokra/status/969633336732905474
|
|
99
94
|
// https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
|
|
100
95
|
// splitChunks: {
|
|
@@ -107,11 +102,12 @@ function _default(dev) {
|
|
|
107
102
|
// runtimeChunk: {
|
|
108
103
|
// name: (entrypoint) => `runtime-${entrypoint.name}`,
|
|
109
104
|
// },
|
|
110
|
-
|
|
111
105
|
};
|
|
106
|
+
|
|
112
107
|
return {
|
|
113
108
|
optimization,
|
|
114
|
-
plugins: [
|
|
109
|
+
plugins: [
|
|
110
|
+
// Generate an asset manifest file with the following content:
|
|
115
111
|
// - "files" key: Mapping of all asset filenames to their corresponding
|
|
116
112
|
// output file so that tools can pick it up without having to parse
|
|
117
113
|
// `index.html`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dev","optimization","undefined","minimize","minimizer","TerserPlugin","minify","esbuildMinify","terserOptions","minifyWhitespace","minifyIdentifiers","minifySyntax","CssMinimizerPlugin","minimizerOptions","preset","minifyFontValues","removeQuotes","plugins","filter","Boolean","performance"],"sources":["webpack.config.base.prod.ts"],"sourcesContent":["import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { Configuration } from 'webpack';\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 (dev?: boolean): Configuration {\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 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 // // @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 ].filter(Boolean),\n // Turn off performance processing because we utilize\n // our own hints via the FileSizeReporter\n performance: false,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["dev","optimization","undefined","minimize","minimizer","TerserPlugin","minify","esbuildMinify","terserOptions","minifyWhitespace","minifyIdentifiers","minifySyntax","CssMinimizerPlugin","minimizerOptions","preset","minifyFontValues","removeQuotes","plugins","filter","Boolean","performance"],"sources":["webpack.config.base.prod.ts"],"sourcesContent":["import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { Configuration } from 'webpack';\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 (dev?: boolean): Configuration {\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 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 // // @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 ].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;AAEA;;AAEA;AACA;AACA;AACe,kBAAUA,GAAa,EAAiB;EACrD,MAAMC,YAAY,GAAGD,GAAG,GACpBE,SAAS,GACT;IACEC,QAAQ,EAAE,IAAI;IACdC,SAAS,EAAE,CACT,KAAIC,8BAAY,EAAC;MACfC,MAAM,EAAED,8BAAY,CAACE,aAAa;MAClC;MACA;MACA;MACAC,aAAa,EAAE;QACbF,MAAM,EAAE,KAAK;QACbG,gBAAgB,EAAE,IAAI;QACtB;QACAC,iBAAiB,EAAE,KAAK;QACxB;QACAC,YAAY,EAAE;MAChB;MACA;IACF,CAAC,CAAC;IAEF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,KAAIC,oCAAkB,EAAC;MACrBC,gBAAgB,EAAE;QAChBC,MAAM,EAAE,CACN,SAAS,EACT;UACEC,gBAAgB,EAAE;YAAEC,YAAY,EAAE;UAAM;QAC1C,CAAC;MAEL;IACF,CAAC,CAAC;IAEJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;EACF,CAAC;;EAEL,OAAO;IACLf,YAAY;IAEZgB,OAAO,EAAE;MACP;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;IAAA,CACD,CAACC,MAAM,CAACC,OAAO,CAAC;IACjB;IACA;IACAC,WAAW,EAAE;EACf,CAAC;AACH"}
|
|
@@ -1,51 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = _default;
|
|
9
|
-
|
|
10
8
|
function _path() {
|
|
11
9
|
const data = _interopRequireDefault(require("path"));
|
|
12
|
-
|
|
13
10
|
_path = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
function _componentId() {
|
|
21
16
|
const data = require("@teambit/component-id");
|
|
22
|
-
|
|
23
17
|
_componentId = function () {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
require("@teambit/react.babel.bit-react-transformer");
|
|
31
|
-
|
|
32
23
|
function _reactRefreshWebpackPlugin() {
|
|
33
24
|
const data = _interopRequireDefault(require("@pmmmwh/react-refresh-webpack-plugin"));
|
|
34
|
-
|
|
35
25
|
_reactRefreshWebpackPlugin = function () {
|
|
36
26
|
return data;
|
|
37
27
|
};
|
|
38
|
-
|
|
39
28
|
return data;
|
|
40
29
|
}
|
|
41
|
-
|
|
42
30
|
// Make sure the bit-react-transformer is a dependency
|
|
43
31
|
// TODO: remove it once we can set policy from component to component then set it via the component.json
|
|
44
|
-
|
|
32
|
+
|
|
33
|
+
const matchNothingRegex = 'a^';
|
|
34
|
+
|
|
35
|
+
// This is the production and development configuration.
|
|
45
36
|
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
|
|
46
37
|
// eslint-disable-next-line complexity
|
|
47
38
|
// export default function (workDir: string, envId: string): Configuration {
|
|
48
|
-
|
|
49
39
|
function _default(workDir, envId) {
|
|
50
40
|
return {
|
|
51
41
|
module: {
|
|
@@ -74,14 +64,16 @@ function _default(workDir, envId) {
|
|
|
74
64
|
options: {
|
|
75
65
|
babelrc: false,
|
|
76
66
|
configFile: false,
|
|
77
|
-
plugins: [require.resolve('react-refresh/babel'),
|
|
67
|
+
plugins: [require.resolve('react-refresh/babel'),
|
|
68
|
+
// for component highlighting in preview.
|
|
78
69
|
[require.resolve('@teambit/react.babel.bit-react-transformer')]],
|
|
79
70
|
// turn off all optimizations (only slow down for node_modules)
|
|
80
71
|
compact: false,
|
|
81
72
|
minified: false
|
|
82
73
|
}
|
|
83
74
|
}]
|
|
84
|
-
},
|
|
75
|
+
},
|
|
76
|
+
// MDX support (move to the mdx aspect and extend from there)
|
|
85
77
|
{
|
|
86
78
|
test: /\.mdx?$/,
|
|
87
79
|
// to skip any files linked from other projects (like Bit itself)
|
|
@@ -103,7 +95,8 @@ function _default(workDir, envId) {
|
|
|
103
95
|
}]
|
|
104
96
|
}]
|
|
105
97
|
},
|
|
106
|
-
plugins: [
|
|
98
|
+
plugins: [
|
|
99
|
+
// No need here as we have `hot: true` in the dev server
|
|
107
100
|
// new webpack.HotModuleReplacementPlugin({}),
|
|
108
101
|
new (_reactRefreshWebpackPlugin().default)({
|
|
109
102
|
overlay: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["matchNothingRegex","workDir","envId","module","rules","test","enforce","include","path","join","descriptionData","componentId","value","use","require","resolve","ComponentID","isValidObject","loader","options","babelrc","configFile","plugins","compact","minified","presets","ReactRefreshWebpackPlugin","overlay","sockPath","entry"],"sources":["webpack.config.component.dev.ts"],"sourcesContent":["import path from 'path';\nimport { Configuration } from 'webpack';\nimport { ComponentID } from '@teambit/component-id';\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';\nimport ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';\n\nconst matchNothingRegex = 'a^';\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\n// export default function (workDir: string, envId: string): Configuration {\nexport default function (workDir: string, envId: string): Configuration {\n return {\n module: {\n rules: [\n {\n test: /\\.js$/,\n enforce: 'pre',\n // limit loader to files in the current project,\n // to skip any files linked from other projects (like Bit itself)\n include: path.join(workDir, 'node_modules'),\n // only apply to packages with componentId in their package.json (ie. bit components)\n descriptionData: { componentId: (value) => !!value },\n use: [require.resolve('source-map-loader')],\n },\n {\n test: /\\.js$/,\n // limit loader to files in the current project,\n // to skip any files linked from other projects (like Bit itself)\n include: path.join(workDir, 'node_modules'),\n // only apply to packages with componentId in their package.json (ie. bit components)\n descriptionData: { componentId: ComponentID.isValidObject },\n use: [\n require.resolve('@pmmmwh/react-refresh-webpack-plugin/loader'),\n {\n loader: require.resolve('babel-loader'),\n options: {\n babelrc: false,\n configFile: false,\n plugins: [\n require.resolve('react-refresh/babel'),\n // for component highlighting in preview.\n [require.resolve('@teambit/react.babel.bit-react-transformer')],\n ],\n // turn off all optimizations (only slow down for node_modules)\n compact: false,\n minified: false,\n },\n },\n ],\n },\n // MDX support (move to the mdx aspect and extend from there)\n {\n test: /\\.mdx?$/,\n // to skip any files linked from other projects (like Bit itself)\n include: path.join(workDir, 'node_modules'),\n // only apply to packages with componentId in their package.json (ie. bit components)\n descriptionData: { componentId: (value) => !!value },\n use: [\n require.resolve('@pmmmwh/react-refresh-webpack-plugin/loader'),\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 plugins: [require.resolve('react-refresh/babel')],\n },\n },\n {\n loader: require.resolve('@teambit/mdx.modules.mdx-loader'),\n },\n ],\n },\n ],\n },\n plugins: [\n // No need here as we have `hot: true` in the dev server\n // new webpack.HotModuleReplacementPlugin({}),\n new ReactRefreshWebpackPlugin({\n overlay: {\n sockPath: `_hmr/${envId}`,\n // TODO - react-error-overlay not showing runtime errors - https://github.com/teambit/bit/issues/5452\n entry: require.resolve('./overlay/webpackHotDevClient'),\n module: require.resolve('./overlay/refreshOverlayInterop'),\n },\n\n // we use '@pmmmwh/react-refresh-webpack-plugin/loader' directly where relevant.\n // FYI, original defaults of the plugin are:\n // include: /\\.([cm]js|[jt]sx?|flow)$/i, exclude: /node_modules/,\n include: matchNothingRegex,\n }),\n ],\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["matchNothingRegex","workDir","envId","module","rules","test","enforce","include","path","join","descriptionData","componentId","value","use","require","resolve","ComponentID","isValidObject","loader","options","babelrc","configFile","plugins","compact","minified","presets","ReactRefreshWebpackPlugin","overlay","sockPath","entry"],"sources":["webpack.config.component.dev.ts"],"sourcesContent":["import path from 'path';\nimport { Configuration } from 'webpack';\nimport { ComponentID } from '@teambit/component-id';\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';\nimport ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';\n\nconst matchNothingRegex = 'a^';\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\n// export default function (workDir: string, envId: string): Configuration {\nexport default function (workDir: string, envId: string): Configuration {\n return {\n module: {\n rules: [\n {\n test: /\\.js$/,\n enforce: 'pre',\n // limit loader to files in the current project,\n // to skip any files linked from other projects (like Bit itself)\n include: path.join(workDir, 'node_modules'),\n // only apply to packages with componentId in their package.json (ie. bit components)\n descriptionData: { componentId: (value) => !!value },\n use: [require.resolve('source-map-loader')],\n },\n {\n test: /\\.js$/,\n // limit loader to files in the current project,\n // to skip any files linked from other projects (like Bit itself)\n include: path.join(workDir, 'node_modules'),\n // only apply to packages with componentId in their package.json (ie. bit components)\n descriptionData: { componentId: ComponentID.isValidObject },\n use: [\n require.resolve('@pmmmwh/react-refresh-webpack-plugin/loader'),\n {\n loader: require.resolve('babel-loader'),\n options: {\n babelrc: false,\n configFile: false,\n plugins: [\n require.resolve('react-refresh/babel'),\n // for component highlighting in preview.\n [require.resolve('@teambit/react.babel.bit-react-transformer')],\n ],\n // turn off all optimizations (only slow down for node_modules)\n compact: false,\n minified: false,\n },\n },\n ],\n },\n // MDX support (move to the mdx aspect and extend from there)\n {\n test: /\\.mdx?$/,\n // to skip any files linked from other projects (like Bit itself)\n include: path.join(workDir, 'node_modules'),\n // only apply to packages with componentId in their package.json (ie. bit components)\n descriptionData: { componentId: (value) => !!value },\n use: [\n require.resolve('@pmmmwh/react-refresh-webpack-plugin/loader'),\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 plugins: [require.resolve('react-refresh/babel')],\n },\n },\n {\n loader: require.resolve('@teambit/mdx.modules.mdx-loader'),\n },\n ],\n },\n ],\n },\n plugins: [\n // No need here as we have `hot: true` in the dev server\n // new webpack.HotModuleReplacementPlugin({}),\n new ReactRefreshWebpackPlugin({\n overlay: {\n sockPath: `_hmr/${envId}`,\n // TODO - react-error-overlay not showing runtime errors - https://github.com/teambit/bit/issues/5452\n entry: require.resolve('./overlay/webpackHotDevClient'),\n module: require.resolve('./overlay/refreshOverlayInterop'),\n },\n\n // we use '@pmmmwh/react-refresh-webpack-plugin/loader' directly where relevant.\n // FYI, original defaults of the plugin are:\n // include: /\\.([cm]js|[jt]sx?|flow)$/i, exclude: /node_modules/,\n include: matchNothingRegex,\n }),\n ],\n };\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAHA;AACA;;AAIA,MAAMA,iBAAiB,GAAG,IAAI;;AAE9B;AACA;AACA;AACA;AACe,kBAAUC,OAAe,EAAEC,KAAa,EAAiB;EACtE,OAAO;IACLC,MAAM,EAAE;MACNC,KAAK,EAAE,CACL;QACEC,IAAI,EAAE,OAAO;QACbC,OAAO,EAAE,KAAK;QACd;QACA;QACAC,OAAO,EAAEC,eAAI,CAACC,IAAI,CAACR,OAAO,EAAE,cAAc,CAAC;QAC3C;QACAS,eAAe,EAAE;UAAEC,WAAW,EAAGC,KAAK,IAAK,CAAC,CAACA;QAAM,CAAC;QACpDC,GAAG,EAAE,CAACC,OAAO,CAACC,OAAO,CAAC,mBAAmB,CAAC;MAC5C,CAAC,EACD;QACEV,IAAI,EAAE,OAAO;QACb;QACA;QACAE,OAAO,EAAEC,eAAI,CAACC,IAAI,CAACR,OAAO,EAAE,cAAc,CAAC;QAC3C;QACAS,eAAe,EAAE;UAAEC,WAAW,EAAEK,0BAAW,CAACC;QAAc,CAAC;QAC3DJ,GAAG,EAAE,CACHC,OAAO,CAACC,OAAO,CAAC,6CAA6C,CAAC,EAC9D;UACEG,MAAM,EAAEJ,OAAO,CAACC,OAAO,CAAC,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