@teambit/react 0.0.668 → 0.0.671

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.
Files changed (54) hide show
  1. package/artifacts/env-template/public/141.js +2 -2
  2. package/artifacts/env-template/public/181.js +1 -1
  3. package/artifacts/env-template/public/719.js +26 -11
  4. package/artifacts/env-template/public/829.js +1 -0
  5. package/artifacts/env-template/public/848.js +1 -1
  6. package/artifacts/env-template/public/assets-manifest.json +10 -10
  7. package/artifacts/env-template/public/{compositions.b8cf1bae61d6770fb256.js → compositions.3a5b55372d389b93bbf2.js} +1 -1
  8. package/artifacts/env-template/public/compositions.html +1 -1
  9. package/artifacts/env-template/public/overview.a7c4a3fa35bd26ab4b80.js +1 -0
  10. package/artifacts/env-template/public/overview.html +1 -1
  11. package/artifacts/env-template/public/preview-root.5e21ef02ac0649aa70d0.js +1 -0
  12. package/artifacts/env-template/public/service-worker.js +1 -1
  13. package/artifacts/env-template/public/static/css/719.4b9f4359.css +1 -0
  14. package/artifacts/preview/teambit_react_react-preview.js +1 -1
  15. package/{compositions-1646709972516.js → compositions-1646920477648.js} +0 -0
  16. package/dist/templates/react-component/files/index-file.d.ts +5 -0
  17. package/dist/templates/react-component/files/index-file.js +23 -0
  18. package/dist/templates/react-component/files/index-file.js.map +1 -0
  19. package/dist/templates/react-component/index.js +38 -29
  20. package/dist/templates/react-component/index.js.map +1 -1
  21. package/dist/templates/react-component-js/index.js +27 -17
  22. package/dist/templates/react-component-js/index.js.map +1 -1
  23. package/dist/templates/react-context/files/index-file.d.ts +5 -0
  24. package/dist/templates/react-context/files/index-file.js +25 -0
  25. package/dist/templates/react-context/files/index-file.js.map +1 -0
  26. package/dist/templates/react-context/index.js +17 -14
  27. package/dist/templates/react-context/index.js.map +1 -1
  28. package/dist/templates/react-env/index.js +6 -0
  29. package/dist/templates/react-env/index.js.map +1 -1
  30. package/dist/templates/react-hook/files/index-file.d.ts +5 -0
  31. package/dist/templates/react-hook/files/index-file.js +22 -0
  32. package/dist/templates/react-hook/files/index-file.js.map +1 -0
  33. package/dist/templates/react-hook/index.js +17 -11
  34. package/dist/templates/react-hook/index.js.map +1 -1
  35. package/dist/webpack/webpack.config.base.js +12 -0
  36. package/dist/webpack/webpack.config.base.js.map +1 -1
  37. package/{overview-1646709972516.js → overview-1646920477648.js} +0 -0
  38. package/package-tar/teambit-react-0.0.671.tgz +0 -0
  39. package/package.json +30 -30
  40. package/{preview-1646709972516.js → preview-1646920477648.js} +2 -2
  41. package/templates/react-component/files/index-file.ts +12 -0
  42. package/templates/react-component/index.ts +8 -22
  43. package/templates/react-component-js/index.ts +6 -13
  44. package/templates/react-context/files/index-file.ts +14 -0
  45. package/templates/react-context/index.ts +7 -11
  46. package/templates/react-env/index.ts +6 -0
  47. package/templates/react-hook/files/index-file.ts +11 -0
  48. package/templates/react-hook/index.ts +7 -8
  49. package/webpack/webpack.config.base.ts +14 -0
  50. package/artifacts/env-template/public/130.js +0 -1
  51. package/artifacts/env-template/public/overview.8e9cce77964a6de8a067.js +0 -1
  52. package/artifacts/env-template/public/preview-root.fc3344d908c6099ff850.js +0 -1
  53. package/artifacts/env-template/public/static/css/719.fc2ace3d.css +0 -1
  54. package/package-tar/teambit-react-0.0.668.tgz +0 -0
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.indexFile = void 0;
7
+
8
+ const indexFile = context => {
9
+ const {
10
+ name,
11
+ namePascalCase: Name
12
+ } = context;
13
+ return {
14
+ relativePath: 'index.ts',
15
+ content: `export { ${Name} } from './${name}';
16
+ export type { ${Name}Props } from './${name}';
17
+ `
18
+ };
19
+ };
20
+
21
+ exports.indexFile = indexFile;
22
+
23
+ //# sourceMappingURL=index-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index-file.ts"],"names":["indexFile","context","name","namePascalCase","Name","relativePath","content"],"mappings":";;;;;;;AAEO,MAAMA,SAAS,GAAIC,OAAD,IAA+B;AACtD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,cAAc,EAAEC;AAAxB,MAAiCH,OAAvC;AAEA,SAAO;AACLI,IAAAA,YAAY,EAAE,UADT;AAELC,IAAAA,OAAO,EAAG,YAAWF,IAAK,cAAaF,IAAK;AAChD,gBAAgBE,IAAK,mBAAkBF,IAAK;AAC5C;AAJS,GAAP;AAMD,CATM","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const indexFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: 'index.ts',\n content: `export { ${Name} } from './${name}';\nexport type { ${Name}Props } from './${name}';\n`,\n };\n}\n"]}
@@ -1,10 +1,22 @@
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.reactComponent = exports.deprecatedReactComponent = void 0;
7
9
 
10
+ function _defineProperty2() {
11
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+
13
+ _defineProperty2 = function () {
14
+ return data;
15
+ };
16
+
17
+ return data;
18
+ }
19
+
8
20
  function _component() {
9
21
  const data = require("./files/component");
10
22
 
@@ -45,42 +57,39 @@ function _test() {
45
57
  return data;
46
58
  }
47
59
 
60
+ function _indexFile() {
61
+ const data = require("./files/index-file");
62
+
63
+ _indexFile = function () {
64
+ return data;
65
+ };
66
+
67
+ return data;
68
+ }
69
+
70
+ 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; }
71
+
72
+ 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; }
73
+
48
74
  const reactComponent = {
49
75
  name: 'react',
50
76
  description: 'a basic react component',
51
77
  generateFiles: context => {
52
- const {
53
- name,
54
- namePascalCase: Name
55
- } = context;
56
- const indexFile = {
57
- relativePath: 'index.ts',
58
- content: `export { ${Name} } from './${name}';
59
- export type { ${Name}Props } from './${name}';
60
- `
61
- };
62
- return [indexFile, (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
63
- }
78
+ return [(0, _indexFile().indexFile)(context), (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
79
+ } // config: {
80
+ // 'teambit.envs/envs': {
81
+ // env: 'teambit.react/react',
82
+ // },
83
+ // }
84
+
64
85
  };
65
86
  exports.reactComponent = reactComponent;
66
- const deprecatedReactComponent = {
87
+
88
+ const deprecatedReactComponent = _objectSpread(_objectSpread({}, reactComponent), {}, {
67
89
  name: 'react-component',
68
- description: 'a basic react component',
69
- hidden: true,
70
- generateFiles: context => {
71
- const {
72
- name,
73
- namePascalCase: Name
74
- } = context;
75
- const indexFile = {
76
- relativePath: 'index.ts',
77
- content: `export { ${Name} } from './${name}';
78
- export type { ${Name}Props } from './${name}';
79
- `
80
- };
81
- return [indexFile, (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
82
- }
83
- };
90
+ hidden: true
91
+ });
92
+
84
93
  exports.deprecatedReactComponent = deprecatedReactComponent;
85
94
 
86
95
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["reactComponent","name","description","generateFiles","context","namePascalC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,SAAD,EAAY,gCAAcH,OAAd,CAAZ,EAAoC,oCAAgBA,OAAhB,CAApC,EAA8D,sBAASA,OAAT,CAA9D,EAAiF,sBAASA,OAAT,CAAjF,CAAP;AACD;AAfwD,CAApD","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\n\nexport const reactComponent: ComponentTemplate = {\n name: 'react',\n description: 'a basic react component',\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { ${Name} } from './${name}';\nexport type { ${Name}Props } from './${name}';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n};\n\nexport const deprecatedReactComponent: ComponentTemplate = {\n name: 'react-component',\n description: 'a basic react component',\n hidden: true,\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { ${Name} } from './${name}';\nexport type { ${Name}Props } from './${name}';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["reactComponent","name","description","generateFiles","context","deprecatedReactComponent","hidden"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEO,MAAMA,cAAiC,GAAG;AAC/CC,EAAAA,IAAI,EAAE,OADyC;AAE/CC,EAAAA,WAAW,EAAE,yBAFkC;AAG/CC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CAAC,4BAAUA,OAAV,CAAD,EAAqB,gCAAcA,OAAd,CAArB,EAA6C,oCAAgBA,OAAhB,CAA7C,EAAuE,sBAASA,OAAT,CAAvE,EAA0F,sBAASA,OAAT,CAA1F,CAAP;AACD,GAL8C,CAM/C;AACA;AACA;AACA;AACA;;AAV+C,CAA1C;;;AAaA,MAAMC,wBAA2C,mCACnDL,cADmD;AAEtDC,EAAAA,IAAI,EAAE,iBAFgD;AAGtDK,EAAAA,MAAM,EAAE;AAH8C,EAAjD","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\nimport { indexFile } from './files/index-file';\n\nexport const reactComponent: ComponentTemplate = {\n name: 'react',\n description: 'a basic react component',\n generateFiles: (context: ComponentContext) => {\n return [indexFile(context), componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n // config: {\n // 'teambit.envs/envs': {\n // env: 'teambit.react/react',\n // },\n // }\n};\n\nexport const deprecatedReactComponent: ComponentTemplate = {\n ...reactComponent,\n name: 'react-component',\n hidden: true,\n};\n"]}
@@ -1,10 +1,22 @@
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.reactComponentJS = exports.deprecatedReactComponentJS = void 0;
7
9
 
10
+ function _defineProperty2() {
11
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+
13
+ _defineProperty2 = function () {
14
+ return data;
15
+ };
16
+
17
+ return data;
18
+ }
19
+
8
20
  function _component() {
9
21
  const data = require("./files/component");
10
22
 
@@ -45,6 +57,10 @@ function _test() {
45
57
  return data;
46
58
  }
47
59
 
60
+ 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; }
61
+
62
+ 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; }
63
+
48
64
  const reactComponentJS = {
49
65
  name: 'react-js',
50
66
  description: 'a basic react component in js',
@@ -59,26 +75,20 @@ const reactComponentJS = {
59
75
  `
60
76
  };
61
77
  return [indexFile, (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
62
- }
78
+ } // config: {
79
+ // 'teambit.envs/envs': {
80
+ // env: 'teambit.react/react',
81
+ // },
82
+ // }
83
+
63
84
  };
64
85
  exports.reactComponentJS = reactComponentJS;
65
- const deprecatedReactComponentJS = {
86
+
87
+ const deprecatedReactComponentJS = _objectSpread(_objectSpread({}, reactComponentJS), {}, {
66
88
  name: 'react-component-js',
67
- description: 'a basic react component in js',
68
- hidden: true,
69
- generateFiles: context => {
70
- const {
71
- name,
72
- namePascalCase: Name
73
- } = context;
74
- const indexFile = {
75
- relativePath: 'index.js',
76
- content: `export { ${Name} } from './${name}';
77
- `
78
- };
79
- return [indexFile, (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
80
- }
81
- };
89
+ hidden: true
90
+ });
91
+
82
92
  exports.deprecatedReactComponentJS = deprecatedReactComponentJS;
83
93
 
84
94
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["reactComponentJS","name","description","generateFiles","context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EAA8D,sBAASA,OAAT,CAA9D,EAAiF,sBAASA,OAAT,CAAjF,CAAP;AACD;AAd0D,CAAtD","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\n\nexport const reactComponentJS: ComponentTemplate = {\n name: 'react-js',\n description: 'a basic react component in js',\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.js',\n content: `export { ${Name} } from './${name}';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n};\n\nexport const deprecatedReactComponentJS: ComponentTemplate = {\n name: 'react-component-js',\n description: 'a basic react component in js',\n hidden: true,\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.js',\n content: `export { ${Name} } from './${name}';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["reactComponentJS","name","description","generateFiles","context","namePascalCase","Name","indexFile","relativePath","content","deprecatedReactComponentJS","hidden"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEO,MAAMA,gBAAmC,GAAG;AACjDC,EAAAA,IAAI,EAAE,UAD2C;AAEjDC,EAAAA,WAAW,EAAE,+BAFoC;AAIjDC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,UAAM;AAAEH,MAAAA,IAAF;AAAQI,MAAAA,cAAc,EAAEC;AAAxB,QAAiCF,OAAvC;AACA,UAAMG,SAAS,GAAG;AAChBC,MAAAA,YAAY,EAAE,UADE;AAEhBC,MAAAA,OAAO,EAAG,YAAWH,IAAK,cAAaL,IAAK;AAClD;AAHsB,KAAlB;AAKA,WAAO,CAACM,SAAD,EAAY,gCAAcH,OAAd,CAAZ,EAAoC,oCAAgBA,OAAhB,CAApC,EAA8D,sBAASA,OAAT,CAA9D,EAAiF,sBAASA,OAAT,CAAjF,CAAP;AACD,GAZgD,CAajD;AACA;AACA;AACA;AACA;;AAjBiD,CAA5C;;;AAoBA,MAAMM,0BAA6C,mCACrDV,gBADqD;AAExDC,EAAAA,IAAI,EAAE,oBAFkD;AAGxDU,EAAAA,MAAM,EAAE;AAHgD,EAAnD","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\n\nexport const reactComponentJS: ComponentTemplate = {\n name: 'react-js',\n description: 'a basic react component in js',\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.js',\n content: `export { ${Name} } from './${name}';\n`,\n };\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n // config: {\n // 'teambit.envs/envs': {\n // env: 'teambit.react/react',\n // },\n // }\n};\n\nexport const deprecatedReactComponentJS: ComponentTemplate = {\n ...reactComponentJS,\n name: 'react-component-js',\n hidden: true,\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+ export declare const indexFile: (context: ComponentContext) => {
3
+ relativePath: string;
4
+ content: string;
5
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.indexFile = void 0;
7
+
8
+ const indexFile = context => {
9
+ const {
10
+ name,
11
+ namePascalCase: Name
12
+ } = context;
13
+ return {
14
+ relativePath: 'index.ts',
15
+ content: `export { ${Name}Context } from './${name}-context';
16
+ export type { ${Name}ContextType } from './${name}-context';
17
+ export { ${Name}Provider } from './${name}-context-provider';
18
+ export type { ${Name}ProviderProps } from './${name}-context-provider';
19
+ `
20
+ };
21
+ };
22
+
23
+ exports.indexFile = indexFile;
24
+
25
+ //# sourceMappingURL=index-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index-file.ts"],"names":["indexFile","context","name","namePascalCase","Name","relativePath","content"],"mappings":";;;;;;;AAEO,MAAMA,SAAS,GAAIC,OAAD,IAA+B;AACtD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,cAAc,EAAEC;AAAxB,MAAiCH,OAAvC;AAEA,SAAO;AACLI,IAAAA,YAAY,EAAE,UADT;AAELC,IAAAA,OAAO,EAAG,YAAWF,IAAK,qBAAoBF,IAAK;AACvD,gBAAgBE,IAAK,yBAAwBF,IAAK;AAClD,WAAWE,IAAK,sBAAqBF,IAAK;AAC1C,gBAAgBE,IAAK,2BAA0BF,IAAK;AACpD;AANS,GAAP;AAQD,CAXM","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const indexFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: 'index.ts',\n content: `export { ${Name}Context } from './${name}-context';\nexport type { ${Name}ContextType } from './${name}-context';\nexport { ${Name}Provider } from './${name}-context-provider';\nexport type { ${Name}ProviderProps } from './${name}-context-provider';\n`,\n };\n}\n"]}
@@ -55,24 +55,27 @@ function _test() {
55
55
  return data;
56
56
  }
57
57
 
58
+ function _indexFile() {
59
+ const data = require("./files/index-file");
60
+
61
+ _indexFile = function () {
62
+ return data;
63
+ };
64
+
65
+ return data;
66
+ }
67
+
58
68
  const reactContext = {
59
69
  name: 'react-context',
60
70
  description: 'a react context component',
61
71
  generateFiles: context => {
62
- const {
63
- name,
64
- namePascalCase: Name
65
- } = context;
66
- const indexFile = {
67
- relativePath: 'index.ts',
68
- content: `export { ${Name}Context } from './${name}-context';
69
- export type { ${Name}ContextType } from './${name}-context';
70
- export { ${Name}Provider } from './${name}-context-provider';
71
- export type { ${Name}ProviderProps } from './${name}-context-provider';
72
- `
73
- };
74
- return [indexFile, (0, _context().contextFile)(context), (0, _contextProvider().contextProviderFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
75
- }
72
+ return [(0, _indexFile().indexFile)(context), (0, _context().contextFile)(context), (0, _contextProvider().contextProviderFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
73
+ } // config: {
74
+ // 'teambit.envs/envs': {
75
+ // env: 'teambit.react/react',
76
+ // },
77
+ // }
78
+
76
79
  };
77
80
  exports.reactContext = reactContext;
78
81
 
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["reactContext","name","description","generateFiles","context","namePascalCase","Name","indexFile","relativePath","content"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,YAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAE,eADuC;AAE7CC,EAAAA,WAAW,EAAE,2BAFgC;AAI7CC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,UAAM;AAAEH,MAAAA,IAAF;AAAQI,MAAAA,cAAc,EAAEC;AAAxB,QAAiCF,OAAvC;AACA,UAAMG,SAAS,GAAG;AAChBC,MAAAA,YAAY,EAAE,UADE;AAEhBC,MAAAA,OAAO,EAAG,YAAWH,IAAK,qBAAoBL,IAAK;AACzD,gBAAgBK,IAAK,yBAAwBL,IAAK;AAClD,WAAWK,IAAK,sBAAqBL,IAAK;AAC1C,gBAAgBK,IAAK,2BAA0BL,IAAK;AACpD;AANsB,KAAlB;AASA,WAAO,CACLM,SADK,EAEL,4BAAYH,OAAZ,CAFK,EAGL,4CAAoBA,OAApB,CAHK,EAIL,oCAAgBA,OAAhB,CAJK,EAKL,sBAASA,OAAT,CALK,EAML,sBAASA,OAAT,CANK,CAAP;AAQD;AAvB4C,CAAxC","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { contextFile } from './files/context';\nimport { contextProviderFile } from './files/context-provider';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\n\nexport const reactContext: ComponentTemplate = {\n name: 'react-context',\n description: 'a react context component',\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { ${Name}Context } from './${name}-context';\nexport type { ${Name}ContextType } from './${name}-context';\nexport { ${Name}Provider } from './${name}-context-provider';\nexport type { ${Name}ProviderProps } from './${name}-context-provider';\n`,\n };\n\n return [\n indexFile,\n contextFile(context),\n contextProviderFile(context),\n compositionFile(context),\n docsFile(context),\n testFile(context),\n ];\n },\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["reactContext","name","description","generateFiles","context"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,YAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAE,eADuC;AAE7CC,EAAAA,WAAW,EAAE,2BAFgC;AAI7CC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CACL,4BAAUA,OAAV,CADK,EAEL,4BAAYA,OAAZ,CAFK,EAGL,4CAAoBA,OAApB,CAHK,EAIL,oCAAgBA,OAAhB,CAJK,EAKL,sBAASA,OAAT,CALK,EAML,sBAASA,OAAT,CANK,CAAP;AAQD,GAb4C,CAc7C;AACA;AACA;AACA;AACA;;AAlB6C,CAAxC","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { contextFile } from './files/context';\nimport { contextProviderFile } from './files/context-provider';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\nimport { indexFile } from './files/index-file';\n\nexport const reactContext: ComponentTemplate = {\n name: 'react-context',\n description: 'a react context component',\n\n generateFiles: (context: ComponentContext) => {\n return [\n indexFile(context),\n contextFile(context),\n contextProviderFile(context),\n compositionFile(context),\n docsFile(context),\n testFile(context),\n ];\n },\n // config: {\n // 'teambit.envs/envs': {\n // env: 'teambit.react/react',\n // },\n // }\n};\n"]}
@@ -115,6 +115,12 @@ const reactEnvTemplate = {
115
115
  relativePath: `jest/jest.config.js`,
116
116
  content: (0, _jest().jestConfigFile)()
117
117
  }];
118
+ },
119
+ config: {
120
+ 'teambit.envs/env': {},
121
+ 'teambit.envs/envs': {
122
+ env: 'teambit.envs/env'
123
+ }
118
124
  }
119
125
  };
120
126
  exports.reactEnvTemplate = reactEnvTemplate;
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["reactEnvTemplate","name","description","generateFiles","context","relativePath","content","isMain"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,gBAAmC,GAAG;AACjDC,EAAAA,IAAI,EAAE,WAD2C;AAEjDC,EAAAA,WAAW,EAAE,0DAFoC;AAGjDC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CACL;AACEC,MAAAA,YAAY,EAAE,UADhB;AAEEC,MAAAA,OAAO,EAAE,wBAAUF,OAAV,CAFX;AAGEG,MAAAA,MAAM,EAAE;AAHV,KADK,EAML;AACEF,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WADhC;AAEEK,MAAAA,OAAO,EAAE,oBAAQF,OAAR;AAFX,KANK,EAUL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,kBADhC;AAEEK,MAAAA,OAAO,EAAE,6BAAgBF,OAAhB;AAFX,KAVK,EAcL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,qBADhC;AAEEK,MAAAA,OAAO,EAAE,mCAAmBF,OAAnB;AAFX,KAdK,EAkBL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,YADhC;AAEEK,MAAAA,OAAO,EAAE,0BAAWF,OAAX;AAFX,KAlBK,EAsBL;AACEC,MAAAA,YAAY,EAAG,iCADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KAtBK,EA0BL;AACED,MAAAA,YAAY,EAAG,0BADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KA1BK,EA8BL;AACED,MAAAA,YAAY,EAAG,qBADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KA9BK,CAAP;AAmCD;AAvCgD,CAA5C","sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainRuntimeFile } from './files/main.runtime';\nimport { previewRuntimeFile } from './files/preview.runtime';\nimport { aspectFile } from './files/aspect';\nimport { webpackConfigFile } from './files/webpack.config';\nimport { typescriptConfigFile } from './files/typescript.config';\nimport { jestConfigFile } from './files/jest.config';\n\nexport const reactEnvTemplate: ComponentTemplate = {\n name: 'react-env',\n description: 'customize the base React env with your configs and tools',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.preview.runtime.ts`,\n content: previewRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `webpack/webpack-transformers.ts`,\n content: webpackConfigFile(),\n },\n {\n relativePath: `typescript/tsconfig.json`,\n content: typescriptConfigFile(),\n },\n {\n relativePath: `jest/jest.config.js`,\n content: jestConfigFile(),\n },\n ];\n },\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["reactEnvTemplate","name","description","generateFiles","context","relativePath","content","isMain","config","env"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,gBAAmC,GAAG;AACjDC,EAAAA,IAAI,EAAE,WAD2C;AAEjDC,EAAAA,WAAW,EAAE,0DAFoC;AAGjDC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CACL;AACEC,MAAAA,YAAY,EAAE,UADhB;AAEEC,MAAAA,OAAO,EAAE,wBAAUF,OAAV,CAFX;AAGEG,MAAAA,MAAM,EAAE;AAHV,KADK,EAML;AACEF,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,WADhC;AAEEK,MAAAA,OAAO,EAAE,oBAAQF,OAAR;AAFX,KANK,EAUL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,kBADhC;AAEEK,MAAAA,OAAO,EAAE,6BAAgBF,OAAhB;AAFX,KAVK,EAcL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,qBADhC;AAEEK,MAAAA,OAAO,EAAE,mCAAmBF,OAAnB;AAFX,KAdK,EAkBL;AACEC,MAAAA,YAAY,EAAG,GAAED,OAAO,CAACH,IAAK,YADhC;AAEEK,MAAAA,OAAO,EAAE,0BAAWF,OAAX;AAFX,KAlBK,EAsBL;AACEC,MAAAA,YAAY,EAAG,iCADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KAtBK,EA0BL;AACED,MAAAA,YAAY,EAAG,0BADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KA1BK,EA8BL;AACED,MAAAA,YAAY,EAAG,qBADjB;AAEEC,MAAAA,OAAO,EAAE;AAFX,KA9BK,CAAP;AAmCD,GAvCgD;AAwCjDE,EAAAA,MAAM,EAAE;AACN,wBAAoB,EADd;AAEN,yBAAqB;AACnBC,MAAAA,GAAG,EAAE;AADc;AAFf;AAxCyC,CAA5C","sourcesContent":["import { ComponentContext, ComponentTemplate } from '@teambit/generator';\nimport { indexFile } from './files/index';\nimport { docFile } from './files/doc';\nimport { mainRuntimeFile } from './files/main.runtime';\nimport { previewRuntimeFile } from './files/preview.runtime';\nimport { aspectFile } from './files/aspect';\nimport { webpackConfigFile } from './files/webpack.config';\nimport { typescriptConfigFile } from './files/typescript.config';\nimport { jestConfigFile } from './files/jest.config';\n\nexport const reactEnvTemplate: ComponentTemplate = {\n name: 'react-env',\n description: 'customize the base React env with your configs and tools',\n generateFiles: (context: ComponentContext) => {\n return [\n {\n relativePath: 'index.ts',\n content: indexFile(context),\n isMain: true,\n },\n {\n relativePath: `${context.name}.docs.mdx`,\n content: docFile(context),\n },\n {\n relativePath: `${context.name}.main.runtime.ts`,\n content: mainRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.preview.runtime.ts`,\n content: previewRuntimeFile(context),\n },\n {\n relativePath: `${context.name}.aspect.ts`,\n content: aspectFile(context),\n },\n {\n relativePath: `webpack/webpack-transformers.ts`,\n content: webpackConfigFile(),\n },\n {\n relativePath: `typescript/tsconfig.json`,\n content: typescriptConfigFile(),\n },\n {\n relativePath: `jest/jest.config.js`,\n content: jestConfigFile(),\n },\n ];\n },\n config: {\n 'teambit.envs/env': {},\n 'teambit.envs/envs': {\n env: 'teambit.envs/env',\n },\n },\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import { ComponentContext } from '@teambit/generator';
2
+ export declare const indexFile: (context: ComponentContext) => {
3
+ relativePath: string;
4
+ content: string;
5
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.indexFile = void 0;
7
+
8
+ const indexFile = context => {
9
+ const {
10
+ name,
11
+ namePascalCase: Name
12
+ } = context;
13
+ return {
14
+ relativePath: 'index.ts',
15
+ content: `export { ${Name} } from './${name}';
16
+ `
17
+ };
18
+ };
19
+
20
+ exports.indexFile = indexFile;
21
+
22
+ //# sourceMappingURL=index-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index-file.ts"],"names":["indexFile","context","name","namePascalCase","Name","relativePath","content"],"mappings":";;;;;;;AAEO,MAAMA,SAAS,GAAIC,OAAD,IAA+B;AACtD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,cAAc,EAAEC;AAAxB,MAAiCH,OAAvC;AAEA,SAAO;AACLI,IAAAA,YAAY,EAAE,UADT;AAELC,IAAAA,OAAO,EAAG,YAAWF,IAAK,cAAaF,IAAK;AAChD;AAHS,GAAP;AAKD,CARM","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const indexFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: 'index.ts',\n content: `export { ${Name} } from './${name}';\n`,\n };\n}\n"]}
@@ -45,21 +45,27 @@ function _test() {
45
45
  return data;
46
46
  }
47
47
 
48
+ function _indexFile() {
49
+ const data = require("./files/index-file");
50
+
51
+ _indexFile = function () {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
48
58
  const reactHook = {
49
59
  name: 'react-hook',
50
60
  description: 'a react hook component',
51
61
  generateFiles: context => {
52
- const {
53
- name,
54
- nameCamelCase: Name
55
- } = context;
56
- const indexFile = {
57
- relativePath: 'index.ts',
58
- content: `export { ${Name} } from './${name}';
59
- `
60
- };
61
- return [indexFile, (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
62
- }
62
+ return [(0, _indexFile().indexFile)(context), (0, _component().componentFile)(context), (0, _composition().compositionFile)(context), (0, _docs().docsFile)(context), (0, _test().testFile)(context)];
63
+ } // config: {
64
+ // 'teambit.envs/envs': {
65
+ // env: 'teambit.react/react',
66
+ // },
67
+ // }
68
+
63
69
  };
64
70
  exports.reactHook = reactHook;
65
71
 
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["reactHook","name","description","generateFiles","context","nameCamelCase","Name","indexFile","relativePath","content"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,SAA4B,GAAG;AAC1CC,EAAAA,IAAI,EAAE,YADoC;AAE1CC,EAAAA,WAAW,EAAE,wBAF6B;AAI1CC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,UAAM;AAAEH,MAAAA,IAAF;AAAQI,MAAAA,aAAa,EAAEC;AAAvB,QAAgCF,OAAtC;AACA,UAAMG,SAAS,GAAG;AAChBC,MAAAA,YAAY,EAAE,UADE;AAEhBC,MAAAA,OAAO,EAAG,YAAWH,IAAK,cAAaL,IAAK;AAClD;AAHsB,KAAlB;AAMA,WAAO,CAACM,SAAD,EAAY,gCAAcH,OAAd,CAAZ,EAAoC,oCAAgBA,OAAhB,CAApC,EAA8D,sBAASA,OAAT,CAA9D,EAAiF,sBAASA,OAAT,CAAjF,CAAP;AACD;AAbyC,CAArC","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\n\nexport const reactHook: ComponentTemplate = {\n name: 'react-hook',\n description: 'a react hook component',\n\n generateFiles: (context: ComponentContext) => {\n const { name, nameCamelCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { ${Name} } from './${name}';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["reactHook","name","description","generateFiles","context"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,SAA4B,GAAG;AAC1CC,EAAAA,IAAI,EAAE,YADoC;AAE1CC,EAAAA,WAAW,EAAE,wBAF6B;AAI1CC,EAAAA,aAAa,EAAGC,OAAD,IAA+B;AAC5C,WAAO,CAAC,4BAAUA,OAAV,CAAD,EAAqB,gCAAcA,OAAd,CAArB,EAA6C,oCAAgBA,OAAhB,CAA7C,EAAuE,sBAASA,OAAT,CAAvE,EAA0F,sBAASA,OAAT,CAA1F,CAAP;AACD,GANyC,CAO1C;AACA;AACA;AACA;AACA;;AAX0C,CAArC","sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\nimport { testFile } from './files/test';\nimport { indexFile } from './files/index-file';\n\nexport const reactHook: ComponentTemplate = {\n name: 'react-hook',\n description: 'a react hook component',\n\n generateFiles: (context: ComponentContext) => {\n return [indexFile(context), componentFile(context), compositionFile(context), docsFile(context), testFile(context)];\n },\n // config: {\n // 'teambit.envs/envs': {\n // env: 'teambit.react/react',\n // },\n // }\n};\n"]}
@@ -332,6 +332,9 @@ function _default(isEnvProduction = false) {
332
332
  dataUrlCondition: {
333
333
  maxSize: imageInlineSizeLimit
334
334
  }
335
+ },
336
+ generator: {
337
+ filename: 'static/images/[hash][ext][query]'
335
338
  }
336
339
  }, {
337
340
  // loads svg as both inlineUrl and react component, like:
@@ -354,6 +357,12 @@ function _default(isEnvProduction = false) {
354
357
  type: 'asset' // export a data URI or emit a separate file
355
358
 
356
359
  }]
360
+ }, {
361
+ test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
362
+ type: 'asset',
363
+ generator: {
364
+ filename: 'static/fonts/[hash][ext][query]'
365
+ }
357
366
  }, // "file" loader makes sure those assets get served by WebpackDevServer.
358
367
  // When you `import` an asset, you get its (virtual) filename.
359
368
  // In production, they would get copied to the `build` folder.
@@ -365,6 +374,9 @@ function _default(isEnvProduction = false) {
365
374
  // Also exclude `html` and `json` extensions so they get processed
366
375
  // by webpacks internal loaders.
367
376
  exclude: [/\.(js|mjs|cjs|jsx|ts|tsx)$/, /\.html$/, /\.mdx?/, /\.json$/, /\.css$/],
377
+ generator: {
378
+ filename: 'static/[hash][ext][query]'
379
+ },
368
380
  type: 'asset'
369
381
  } // ** STOP ** Are you adding a new loader?
370
382
  // Make sure to add the new loader(s) before the "type:asset" loader.
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack.config.base.ts"],"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","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","dependency","not","titleProp","ref","plugins","filename","chunkFilename","IgnorePlugin","resourceRegExp","contextRegExp","filter","Boolean","performance"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;;AAEA;;;;;;;;;;AAEA,MAAMA,eAAe,GAAGC,OAAO,CAACC,OAAR,CAAgB,cAAhB,CAAxB;;AAEA,MAAMC,oBAAoB,GAAG,CAC3B,SAD2B,EAE3B,KAF2B,EAG3B,QAH2B,EAI3B,IAJ2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,EAAE;AAAEyB,gBAAAA,SAAS,EAAE,IAAb;AAAmBC,gBAAAA,GAAG,EAAE;AAAxB;AAFX,aADG,EAKHjE,OAAO,CAACC,OAAR,CAAgB,gBAAhB,CALG;AAFP,WADK,EAWL;AACEyD,YAAAA,IAAI,EAAE,OADR,CACiB;;AADjB,WAXK;AALT,SAzMK,EA8NL;AACA;AACA;AACA;AACA;AACA;AACE;AACA;AACA;AACA;AACApB,UAAAA,OAAO,EAAE,CAAC,4BAAD,EAA+B,SAA/B,EAA0C,QAA1C,EAAoD,SAApD,EAA+D,QAA/D,CALX;AAMEoB,UAAAA,IAAI,EAAE;AANR,SAnOK,CA2OL;AACA;AA5OK;AAJT,OAPK;AAFD,KA3BH;AAyRL;AACAQ,IAAAA,OAAO,EAAE,CACPxD,eAAe,IACb,KAAIM,+BAAJ,EAAyB;AACvB;AACA;AACAmD,MAAAA,QAAQ,EAAE,uCAHa;AAIvBC,MAAAA,aAAa,EAAE;AAJQ,KAAzB,CAFK,EAQP;AACA;AACA;AACA;AACA;AACA,SAAIC,uBAAJ,EAAiB;AACfC,MAAAA,cAAc,EAAE,cADD;AAEfC,MAAAA,aAAa,EAAE;AAFA,KAAjB,CAbO,EAiBPC,MAjBO,CAiBAC,OAjBA,CA1RJ;AA4SL;AACA;AACAC,IAAAA,WAAW,EAAE;AA9SR,GAAP;AAgTD","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 // Support React Native Web\n // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/\n // TODO: @uri please remember to remove after publishing evangelist and base-ui\n\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 },\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 // \"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 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"]}
1
+ {"version":3,"sources":["webpack.config.base.ts"],"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","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"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;;AAEA;;;;;;;;;;AAEA,MAAMA,eAAe,GAAGC,OAAO,CAACC,OAAR,CAAgB,cAAhB,CAAxB;;AAEA,MAAMC,oBAAoB,GAAG,CAC3B,SAD2B,E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A,GAAG,EAAE,CACH;AACEhB,cAAAA,MAAM,EAAEjB,OAAO,CAACC,OAAR,CAAgB,eAAhB,CADV;AAEEsC,cAAAA,OAAO,EAAE;AAAE2B,gBAAAA,SAAS,EAAE,IAAb;AAAmBC,gBAAAA,GAAG,EAAE;AAAxB;AAFX,aADG,EAKHnE,OAAO,CAACC,OAAR,CAAgB,gBAAhB,CALG;AAFP,WADK,EAWL;AACEyD,YAAAA,IAAI,EAAE,OADR,CACiB;;AADjB,WAXK;AALT,SA5MK,EAiOL;AACE9B,UAAAA,IAAI,EAAE,+CADR;AAEE8B,UAAAA,IAAI,EAAE,OAFR;AAGEI,UAAAA,SAAS,EAAE;AACTC,YAAAA,QAAQ,EAAE;AADD;AAHb,SAjOK,EAyOL;AACA;AACA;AACA;AACA;AACA;AACE;AACA;AACA;AACA;AACAzB,UAAAA,OAAO,EAAE,CAAC,4BAAD,EAA+B,SAA/B,EAA0C,QAA1C,EAAoD,SAApD,EAA+D,QAA/D,CALX;AAMEwB,UAAAA,SAAS,EAAE;AACTC,YAAAA,QAAQ,EAAE;AADD,WANb;AASEL,UAAAA,IAAI,EAAE;AATR,SA9OK,CAyPL;AACA;AA1PK;AAJT,OAPK;AAFD,KA3BH;AAuSL;AACAU,IAAAA,OAAO,EAAE,CACP1D,eAAe,IACb,KAAIM,+BAAJ,EAAyB;AACvB;AACA;AACA+C,MAAAA,QAAQ,EAAE,uCAHa;AAIvBM,MAAAA,aAAa,EAAE;AAJQ,KAAzB,CAFK,EAQP;AACA;AACA;AACA;AACA;AACA,SAAIC,uBAAJ,EAAiB;AACfC,MAAAA,cAAc,EAAE,cADD;AAEfC,MAAAA,aAAa,EAAE;AAFA,KAAjB,CAbO,EAiBPC,MAjBO,CAiBAC,OAjBA,CAxSJ;AA0TL;AACA;AACAC,IAAAA,WAAW,EAAE;AA5TR,GAAP;AA8TD","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 // Support React Native Web\n // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/\n // TODO: @uri please remember to remove after publishing evangelist and base-ui\n\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"]}