@papillonarts/setup 0.49.0 → 0.49.1

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 (49) hide show
  1. package/LICENSE +1 -1
  2. package/build/babel/index.d.ts +3 -1
  3. package/build/babel/index.js +6 -1
  4. package/build/eslint/index.d.mts +1 -1
  5. package/build/eslint/index.d.mts.map +1 -1
  6. package/build/eslint/index.mjs +1 -0
  7. package/build/jest/config.d.ts +9 -5
  8. package/build/jest/config.d.ts.map +1 -1
  9. package/build/jest/config.js +19 -20
  10. package/build/jest/index.js +6 -6
  11. package/build/jest/setup.d.ts.map +1 -1
  12. package/build/jest/setup.js +38 -44
  13. package/build/jest/utility.js +16 -87
  14. package/build/storybook/index.js +3 -3
  15. package/build/storybook/mainSetup.d.ts.map +1 -1
  16. package/build/storybook/mainSetup.js +104 -104
  17. package/build/storybook/managerSetup.js +5 -4
  18. package/build/storybook/previewSetup.js +6 -3
  19. package/build/stylelint/index.d.ts +1 -0
  20. package/build/stylelint/index.js +4 -1
  21. package/build/webpack/constant/index.d.ts +0 -1
  22. package/build/webpack/constant/index.d.ts.map +1 -1
  23. package/build/webpack/constant/index.js +6 -7
  24. package/build/webpack/index.js +31 -31
  25. package/build/webpack/loader/babelLoader.d.ts +3 -2
  26. package/build/webpack/loader/babelLoader.d.ts.map +1 -1
  27. package/build/webpack/loader/babelLoader.js +8 -3
  28. package/build/webpack/loader/cssLoader.js +8 -7
  29. package/build/webpack/loader/postCSSLoader.js +1 -3
  30. package/build/webpack/loader/sassLoader.js +4 -3
  31. package/build/webpack/plugin/bannerPlugin.js +3 -3
  32. package/build/webpack/plugin/cleanWebpackPlugin.js +16 -15
  33. package/build/webpack/plugin/copyWebpackPlugin.js +8 -7
  34. package/build/webpack/plugin/cssMinimizerWebpackPlugin.js +2 -2
  35. package/build/webpack/plugin/dotenvWebpack.d.ts +3 -2
  36. package/build/webpack/plugin/dotenvWebpack.d.ts.map +1 -1
  37. package/build/webpack/plugin/dotenvWebpack.js +23 -21
  38. package/build/webpack/plugin/forkTSCheckerWebpackPlugin.js +2 -2
  39. package/build/webpack/plugin/hotModuleReplacementPlugin.js +2 -2
  40. package/build/webpack/plugin/htmlWebpackPlugin.js +23 -21
  41. package/build/webpack/plugin/miniCSSExtractPlugin.js +4 -4
  42. package/build/webpack/plugin/moduleConcatenationPlugin.js +2 -2
  43. package/build/webpack/plugin/webpackManifestPlugin.js +1 -1
  44. package/build/webpack/setup/commonSetup.d.ts +3 -2
  45. package/build/webpack/setup/commonSetup.d.ts.map +1 -1
  46. package/build/webpack/setup/commonSetup.js +6 -5
  47. package/build/webpack/setup/developmentSetup.js +7 -6
  48. package/build/webpack/setup/productionSetup.js +7 -6
  49. package/package.json +12 -12
@@ -1,32 +1,44 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.getStorybookMainSetup = getStorybookMainSetup;
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
8
  var _object = require("@papillonarts/library/object");
12
9
  var _webpack = require("@papillonarts/setup/webpack");
13
10
  var _forkTsCheckerWebpackPlugin = _interopRequireDefault(require("fork-ts-checker-webpack-plugin"));
14
11
  var _webpack2 = _interopRequireDefault(require("webpack"));
15
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // https://storybook.js.org/docs/configure#configure-story-loading
12
+ // https://storybook.js.org/docs/configure#configure-story-loading
17
13
  /* eslint-disable import-x/no-named-as-default */
14
+
18
15
  // https://storybook.js.org/docs/api
19
16
  // https://storybook.js.org/docs/api/main-config/main-config
20
17
  // https://storybook.js.org/docs/api/csf/csf-next#definemain
21
- function getStorybookMainSetup(_ref) {
22
- var stories = _ref.stories,
23
- staticDirs = _ref.staticDirs,
24
- includePaths = _ref.includePaths;
25
- var config = {
18
+ function getStorybookMainSetup({
19
+ stories,
20
+ staticDirs,
21
+ includePaths
22
+ }) {
23
+ const config = {
26
24
  // https://storybook.js.org/docs/api/main-config/main-config-preview-body
27
- previewBody: function previewBody(body) {
25
+ previewBody: body => {
28
26
  // https://github.com/storybookjs/storybook/issues/24429
29
- return "\n ".concat(body, "\n <script type=\"text/javascript\">\n (() => {\n document.addEventListener('DOMContentLoaded', function() {\n const storybookRootElement = document.getElementById(\"storybook-root\")\n\n // https://primer.style/foundations/primitives/getting-started\n storybookRootElement.setAttribute(\"data-color-mode\", \"light\")\n storybookRootElement.setAttribute(\"data-light-theme\", \"light\")\n storybookRootElement.setAttribute(\"data-dark-theme\", \"dark\")\n });\n })()\n </script>\n ");
27
+ return `
28
+ ${body}
29
+ <script type="text/javascript">
30
+ (() => {
31
+ document.addEventListener('DOMContentLoaded', function() {
32
+ const storybookRootElement = document.getElementById("storybook-root")
33
+
34
+ // https://primer.style/foundations/primitives/getting-started
35
+ storybookRootElement.setAttribute("data-color-mode", "light")
36
+ storybookRootElement.setAttribute("data-light-theme", "light")
37
+ storybookRootElement.setAttribute("data-dark-theme", "dark")
38
+ });
39
+ })()
40
+ </script>
41
+ `;
30
42
  },
31
43
  // https://storybook.js.org/docs/react/configure/frameworks
32
44
  framework: {
@@ -38,7 +50,7 @@ function getStorybookMainSetup(_ref) {
38
50
  }
39
51
  },
40
52
  // https://storybook.js.org/docs/react/api/main-config-stories
41
- stories: stories,
53
+ stories,
42
54
  // https://storybook.js.org/docs/react/api/main-config-addons
43
55
  // https://storybook.js.org/docs/react/addons/introduction
44
56
  // https://storybook.js.org/integrations
@@ -81,7 +93,7 @@ function getStorybookMainSetup(_ref) {
81
93
  '@storybook/addon-styling-webpack',
82
94
  // https://storybook.js.org/addons/@storybook/addon-themes
83
95
  // https://github.com/storybookjs/storybook/tree/next/code/addons/themes
84
- '@storybook/addon-themes', '@storybook/addon-webpack5-compiler-babel'],
96
+ '@storybook/addon-themes'],
85
97
  // https://storybook.js.org/docs/react/api/main-config-babel
86
98
  // ...
87
99
 
@@ -130,100 +142,88 @@ function getStorybookMainSetup(_ref) {
130
142
  // https://storybook.js.org/docs/react/api/main-config-static-dirs
131
143
  // https://storybook.js.org/docs/api/main-config/main-config-static-dirs
132
144
  // https://storybook.js.org/docs/configure/integration/images-and-assets#serving-static-files-via-storybook-configuration
133
- staticDirs: staticDirs,
145
+ staticDirs,
134
146
  // https://storybook.js.org/docs/react/api/main-config-typescript
135
147
  // ...
136
148
 
137
149
  // https://storybook.js.org/docs/react/api/main-config-webpack-final
138
- webpackFinal: function () {
139
- var _webpackFinal = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(config, _ref2) {
140
- var configType, fileLoaderRuleSVG;
141
- return _regenerator["default"].wrap(function (_context) {
142
- while (1) switch (_context.prev = _context.next) {
143
- case 0:
144
- configType = _ref2.configType;
145
- // @ts-ignore
146
- fileLoaderRuleSVG = config.module.rules.find(function (rule) {
147
- var _rule$test$test, _rule$test;
148
- return !(0, _object.isEmptyObject)(rule) && ((_rule$test$test = (_rule$test = rule.test).test) === null || _rule$test$test === void 0 ? void 0 : _rule$test$test.call(_rule$test, '.svg'));
149
- }); // @ts-ignore
150
- fileLoaderRuleSVG.exclude = /\.svg$/;
151
- config.module.rules = config.module.rules.concat([{
152
- test: /\.(css|scss)$/,
153
- use: [{
154
- loader: 'style-loader'
155
- }, {
156
- loader: 'css-loader',
157
- options: {
158
- importLoaders: 2,
159
- sourceMap: true,
160
- modules: {
161
- localIdentName: '[name]__[local]___[hash:base64:5]',
162
- /* https://webpack.js.org/loaders/css-loader/#exportlocalsconvention */
163
- exportLocalsConvention: 'as-is'
164
- },
165
- /* https://stackoverflow.com/questions/78589664/style-loader-does-not-recoginize-default-imports-of-css-modules-in-storybooks */
166
- esModule: false
167
- }
168
- }, {
169
- loader: 'postcss-loader',
170
- options: {
171
- postcssOptions: {
172
- sourceMap: true,
173
- plugins: function plugins() {
174
- return [require('postcss-preset-env')()];
175
- },
176
- parser: 'postcss-scss'
177
- }
178
- }
179
- }, {
180
- loader: 'sass-loader',
181
- options: {
182
- sassOptions: {
183
- includePaths: includePaths,
184
- // https://sass-lang.com/documentation/js-api/interfaces/options/#quietDeps
185
- // https://sass-lang.com/documentation/js-api/interfaces/options/#silenceDeprecations
186
- // https://sass-lang.com/documentation/js-api/interfaces/deprecations/
187
- quietDeps: true,
188
- silenceDeprecations: ['import', 'global-builtin']
189
- }
190
- }
191
- }]
192
- }, {
193
- test: /\.svg$/i,
194
- issuer: /\.[jt]sx?$/,
195
- use: ['@svgr/webpack']
196
- }, {
197
- test: /\.story\.mdx$/,
198
- use: [{
199
- loader: 'babel-loader',
200
- options: {
201
- plugins: ['@babel/plugin-transform-react-jsx']
202
- }
203
- }, {
204
- loader: '@mdx-js/loader',
205
- options: {}
206
- }]
207
- }, (0, _webpack.getBabelLoaderAdvancedSetup)()]);
208
- config.plugins.push(new _webpack2["default"].ProvidePlugin({
209
- process: 'process/browser'
210
- }));
211
- config.plugins.push(new _forkTsCheckerWebpackPlugin["default"]());
212
- config.resolve.fallback = _objectSpread(_objectSpread({}, config.resolve.fallback), {}, {
213
- tty: require.resolve('tty-browserify')
214
- });
215
- return _context.abrupt("return", config);
216
- case 1:
217
- case "end":
218
- return _context.stop();
150
+ webpackFinal: async (config, {
151
+ configType // eslint-disable-line
152
+ }) => {
153
+ // @ts-ignore
154
+ const fileLoaderRuleSVG = config.module.rules.find(rule => !(0, _object.isEmptyObject)(rule) && rule.test.test?.('.svg'));
155
+ // @ts-ignore
156
+ fileLoaderRuleSVG.exclude = /\.svg$/;
157
+ config.module.rules = config.module.rules.concat([{
158
+ test: /\.(css|scss)$/,
159
+ use: [{
160
+ loader: 'style-loader'
161
+ }, {
162
+ loader: 'css-loader',
163
+ options: {
164
+ importLoaders: 2,
165
+ sourceMap: true,
166
+ modules: {
167
+ localIdentName: '[name]__[local]___[hash:base64:5]',
168
+ /* https://webpack.js.org/loaders/css-loader/#exportlocalsconvention */
169
+ exportLocalsConvention: 'as-is'
170
+ },
171
+ /* https://stackoverflow.com/questions/78589664/style-loader-does-not-recoginize-default-imports-of-css-modules-in-storybooks */
172
+ esModule: false
173
+ }
174
+ }, {
175
+ loader: 'postcss-loader',
176
+ options: {
177
+ postcssOptions: {
178
+ sourceMap: true,
179
+ plugins: () => [require('postcss-preset-env')()],
180
+ parser: 'postcss-scss'
181
+ }
182
+ }
183
+ }, {
184
+ loader: 'sass-loader',
185
+ options: {
186
+ sassOptions: {
187
+ includePaths,
188
+ // https://sass-lang.com/documentation/js-api/interfaces/options/#quietDeps
189
+ // https://sass-lang.com/documentation/js-api/interfaces/options/#silenceDeprecations
190
+ // https://sass-lang.com/documentation/js-api/interfaces/deprecations/
191
+ quietDeps: true,
192
+ silenceDeprecations: ['import', 'global-builtin']
193
+ }
219
194
  }
220
- }, _callee);
195
+ }]
196
+ }, {
197
+ test: /\.svg$/i,
198
+ issuer: /\.[jt]sx?$/,
199
+ use: ['@svgr/webpack']
200
+ }, {
201
+ test: /\.story\.mdx$/,
202
+ use: [{
203
+ loader: 'babel-loader',
204
+ options: {
205
+ plugins: ['@babel/plugin-transform-react-jsx']
206
+ }
207
+ }, {
208
+ loader: '@mdx-js/loader',
209
+ options: {}
210
+ }]
211
+ }, (0, _webpack.getBabelLoaderAdvancedSetup)()]);
212
+ config.plugins.push(new _webpack2.default.ProvidePlugin({
213
+ process: 'process/browser'
221
214
  }));
222
- function webpackFinal(_x, _x2) {
223
- return _webpackFinal.apply(this, arguments);
224
- }
225
- return webpackFinal;
226
- }(),
215
+ config.plugins.push(new _forkTsCheckerWebpackPlugin.default());
216
+ config.resolve.fallback = {
217
+ ...config.resolve.fallback,
218
+ tty: require.resolve('tty-browserify')
219
+ };
220
+
221
+ // Webpack's ModuleConcatenationPlugin (production-only scope hoisting) throws
222
+ // "Cannot get final name for export '__esModule'" on several components' build output.
223
+ // This is a bundle-size optimization only (no functional effect), safe to disable.
224
+ config.optimization.concatenateModules = false;
225
+ return config;
226
+ },
227
227
  // https://storybook.js.org/docs/api/main-config/main-config-typescript
228
228
  // https://storybook.js.org/docs/configure/integration/typescript
229
229
  typescript: {
@@ -235,7 +235,7 @@ function getStorybookMainSetup(_ref) {
235
235
  reactDocgen: 'react-docgen-typescript',
236
236
  reactDocgenTypescriptOptions: {
237
237
  shouldExtractLiteralValuesFromEnum: true,
238
- propFilter: function propFilter(prop) {
238
+ propFilter: prop => {
239
239
  if (prop.name === 'children') {
240
240
  return true;
241
241
  }
@@ -7,11 +7,12 @@ exports.setStorybookManagerSetup = setStorybookManagerSetup;
7
7
  var _managerApi = require("storybook/manager-api");
8
8
  var _theming = require("storybook/theming");
9
9
  // https://storybook.js.org/docs/configure#configure-storybooks-ui
10
- function setStorybookManagerSetup(_ref) {
11
- var panelPosition = _ref.panelPosition,
12
- theme = _ref.theme;
10
+ function setStorybookManagerSetup({
11
+ panelPosition,
12
+ theme
13
+ }) {
13
14
  _managerApi.addons.setConfig({
14
- panelPosition: panelPosition,
15
+ panelPosition,
15
16
  theme: (0, _theming.create)(theme)
16
17
  });
17
18
  }
@@ -11,9 +11,12 @@ var _jsxRuntime = require("react/jsx-runtime");
11
11
  function getStorybookPreviewSetup() {
12
12
  return {
13
13
  // https://storybook.js.org/docs/writing-stories/decorators
14
- decorators: [function (Story, _ref) {
15
- var parameters = _ref.parameters;
16
- var pageLayout = parameters.pageLayout;
14
+ decorators: [(Story, {
15
+ parameters
16
+ }) => {
17
+ const {
18
+ pageLayout
19
+ } = parameters;
17
20
  switch (pageLayout) {
18
21
  case 'page':
19
22
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
@@ -4,6 +4,7 @@ export declare let plugins: string[];
4
4
  export declare let rules: {
5
5
  'alpha-value-notation': any;
6
6
  'at-rule-no-unknown': any;
7
+ 'at-rule-prelude-no-invalid': any;
7
8
  'color-function-notation': any;
8
9
  'declaration-empty-line-before': any;
9
10
  'keyframes-name-pattern': any;
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  module.exports = {
4
- "extends": ['stylelint-config-standard'],
4
+ extends: ['stylelint-config-standard'],
5
5
  plugins: ['stylelint-order', 'stylelint-prettier', 'stylelint-scss'],
6
6
  rules: {
7
7
  'alpha-value-notation': null,
8
8
  'at-rule-no-unknown': null,
9
+ // SCSS at-rules (e.g. `@mixin Foo($arg: '')`) aren't real CSS at-rules, so this rule's
10
+ // CSS-grammar prelude validation rejects valid SCSS syntax.
11
+ 'at-rule-prelude-no-invalid': null,
9
12
  'color-function-notation': null,
10
13
  'declaration-empty-line-before': null,
11
14
  'keyframes-name-pattern': null,
@@ -1,4 +1,3 @@
1
- export declare const coreJSVersion = "3.47.0";
2
1
  export declare const targetBrowsers: {
3
2
  production: string[];
4
3
  legacyBrowsers: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/constant/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,WAAW,CAAA;AAErC,eAAO,MAAM,cAAc;;;;CAe1B,CAAA;AAED,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,aAAa,eAAe,CAAA;AAEzC,eAAO,MAAM,UAAU,UAAmD,CAAA;AAE1E,eAAO,MAAM,cAAc;;;;CAI1B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/constant/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;CAe1B,CAAA;AAED,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,aAAa,eAAe,CAAA;AAEzC,eAAO,MAAM,UAAU,UAAmD,CAAA;AAE1E,eAAO,MAAM,cAAc;;;;CAI1B,CAAA"}
@@ -3,17 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.targetBrowsers = exports.manifestFileName = exports.indexHTMLName = exports.extensions = exports.extensionAlias = exports.coreJSVersion = void 0;
7
- var coreJSVersion = exports.coreJSVersion = '3.47.0';
8
- var targetBrowsers = exports.targetBrowsers = {
6
+ exports.targetBrowsers = exports.manifestFileName = exports.indexHTMLName = exports.extensions = exports.extensionAlias = void 0;
7
+ const targetBrowsers = exports.targetBrowsers = {
9
8
  production: ['> 1%', 'last 2 versions', 'Firefox ESR'],
10
9
  legacyBrowsers: ['> 1%', 'last 2 versions', 'Firefox ESR'],
11
10
  modernBrowsers: ['last 2 Chrome versions', 'not Chrome < 60', 'last 2 Safari versions', 'not Safari < 10.1', 'last 2 iOS versions', 'not iOS < 10.3', 'last 2 Firefox versions', 'not Firefox < 54', 'last 2 Edge versions', 'not Edge < 15']
12
11
  };
13
- var manifestFileName = exports.manifestFileName = 'manifest.json';
14
- var indexHTMLName = exports.indexHTMLName = 'index.html';
15
- var extensions = exports.extensions = ['.js', '.jsx', '.ts', '.tsx', '.json', '.scss'];
16
- var extensionAlias = exports.extensionAlias = {
12
+ const manifestFileName = exports.manifestFileName = 'manifest.json';
13
+ const indexHTMLName = exports.indexHTMLName = 'index.html';
14
+ const extensions = exports.extensions = ['.js', '.jsx', '.ts', '.tsx', '.json', '.scss'];
15
+ const extensionAlias = exports.extensionAlias = {
17
16
  '.js': ['.js', '.ts'],
18
17
  '.cjs': ['.cjs', '.cts'],
19
18
  '.mjs': ['.mjs', '.mts']
@@ -5,187 +5,187 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "MiniCSSExtractPluginLoader", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _miniCSSExtractPlugin.MiniCSSExtractPluginLoader;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "getBabelLoaderAdvancedSetup", {
13
13
  enumerable: true,
14
- get: function get() {
14
+ get: function () {
15
15
  return _babelLoader.getBabelLoaderAdvancedSetup;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "getBannerPluginStandardSetup", {
19
19
  enumerable: true,
20
- get: function get() {
20
+ get: function () {
21
21
  return _bannerPlugin.getBannerPluginStandardSetup;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "getCSSLoaderStandardSetup", {
25
25
  enumerable: true,
26
- get: function get() {
26
+ get: function () {
27
27
  return _cssLoader.getCSSLoaderStandardSetup;
28
28
  }
29
29
  });
30
30
  Object.defineProperty(exports, "getCSSMinimizerWebpackPluginStandardSetup", {
31
31
  enumerable: true,
32
- get: function get() {
32
+ get: function () {
33
33
  return _cssMinimizerWebpackPlugin.getCSSMinimizerWebpackPluginStandardSetup;
34
34
  }
35
35
  });
36
36
  Object.defineProperty(exports, "getCleanWebpackPluginAdvancedSetup", {
37
37
  enumerable: true,
38
- get: function get() {
38
+ get: function () {
39
39
  return _cleanWebpackPlugin.getCleanWebpackPluginAdvancedSetup;
40
40
  }
41
41
  });
42
42
  Object.defineProperty(exports, "getCleanWebpackPluginStandardSetup", {
43
43
  enumerable: true,
44
- get: function get() {
44
+ get: function () {
45
45
  return _cleanWebpackPlugin.getCleanWebpackPluginStandardSetup;
46
46
  }
47
47
  });
48
48
  Object.defineProperty(exports, "getCopyWebpackPluginStandardSetup", {
49
49
  enumerable: true,
50
- get: function get() {
50
+ get: function () {
51
51
  return _copyWebpackPlugin.getCopyWebpackPluginStandardSetup;
52
52
  }
53
53
  });
54
54
  Object.defineProperty(exports, "getDevServerStandardSetup", {
55
55
  enumerable: true,
56
- get: function get() {
56
+ get: function () {
57
57
  return _devServer.getDevServerStandardSetup;
58
58
  }
59
59
  });
60
60
  Object.defineProperty(exports, "getDotenvWebpackAdvancedSetup", {
61
61
  enumerable: true,
62
- get: function get() {
62
+ get: function () {
63
63
  return _dotenvWebpack.getDotenvWebpackAdvancedSetup;
64
64
  }
65
65
  });
66
66
  Object.defineProperty(exports, "getDotenvWebpackStandardSetup", {
67
67
  enumerable: true,
68
- get: function get() {
68
+ get: function () {
69
69
  return _dotenvWebpack.getDotenvWebpackStandardSetup;
70
70
  }
71
71
  });
72
72
  Object.defineProperty(exports, "getFontLoaderStandardSetup", {
73
73
  enumerable: true,
74
- get: function get() {
74
+ get: function () {
75
75
  return _fontLoader.getFontLoaderStandardSetup;
76
76
  }
77
77
  });
78
78
  Object.defineProperty(exports, "getForkTSCheckerWebpackPluginStandardSetup", {
79
79
  enumerable: true,
80
- get: function get() {
80
+ get: function () {
81
81
  return _forkTSCheckerWebpackPlugin.getForkTSCheckerWebpackPluginStandardSetup;
82
82
  }
83
83
  });
84
84
  Object.defineProperty(exports, "getHotModuleReplacementPluginStandardSetup", {
85
85
  enumerable: true,
86
- get: function get() {
86
+ get: function () {
87
87
  return _hotModuleReplacementPlugin.getHotModuleReplacementPluginStandardSetup;
88
88
  }
89
89
  });
90
90
  Object.defineProperty(exports, "getHtmlWebpackPluginAdvancedSetup", {
91
91
  enumerable: true,
92
- get: function get() {
92
+ get: function () {
93
93
  return _htmlWebpackPlugin.getHtmlWebpackPluginAdvancedSetup;
94
94
  }
95
95
  });
96
96
  Object.defineProperty(exports, "getHtmlWebpackPluginStandardSetup", {
97
97
  enumerable: true,
98
- get: function get() {
98
+ get: function () {
99
99
  return _htmlWebpackPlugin.getHtmlWebpackPluginStandardSetup;
100
100
  }
101
101
  });
102
102
  Object.defineProperty(exports, "getImageLoaderStandardSetup", {
103
103
  enumerable: true,
104
- get: function get() {
104
+ get: function () {
105
105
  return _imageLoader.getImageLoaderStandardSetup;
106
106
  }
107
107
  });
108
108
  Object.defineProperty(exports, "getMarkdownLoaderStandardSetup", {
109
109
  enumerable: true,
110
- get: function get() {
110
+ get: function () {
111
111
  return _markdownLoader.getMarkdownLoaderStandardSetup;
112
112
  }
113
113
  });
114
114
  Object.defineProperty(exports, "getMiniCSSExtractPluginAdvancedSetup", {
115
115
  enumerable: true,
116
- get: function get() {
116
+ get: function () {
117
117
  return _miniCSSExtractPlugin.getMiniCSSExtractPluginAdvancedSetup;
118
118
  }
119
119
  });
120
120
  Object.defineProperty(exports, "getMiniCSSExtractPluginStandardSetup", {
121
121
  enumerable: true,
122
- get: function get() {
122
+ get: function () {
123
123
  return _miniCSSExtractPlugin.getMiniCSSExtractPluginStandardSetup;
124
124
  }
125
125
  });
126
126
  Object.defineProperty(exports, "getModuleConcatenationPluginStandardSetup", {
127
127
  enumerable: true,
128
- get: function get() {
128
+ get: function () {
129
129
  return _moduleConcatenationPlugin.getModuleConcatenationPluginStandardSetup;
130
130
  }
131
131
  });
132
132
  Object.defineProperty(exports, "getPostCSSLoaderStandardSetup", {
133
133
  enumerable: true,
134
- get: function get() {
134
+ get: function () {
135
135
  return _postCSSLoader.getPostCSSLoaderStandardSetup;
136
136
  }
137
137
  });
138
138
  Object.defineProperty(exports, "getSVGRLoaderAdvancedSetup", {
139
139
  enumerable: true,
140
- get: function get() {
140
+ get: function () {
141
141
  return _svgrLoader.getSVGRLoaderAdvancedSetup;
142
142
  }
143
143
  });
144
144
  Object.defineProperty(exports, "getSVGRLoaderStandardSetup", {
145
145
  enumerable: true,
146
- get: function get() {
146
+ get: function () {
147
147
  return _svgrLoader.getSVGRLoaderStandardSetup;
148
148
  }
149
149
  });
150
150
  Object.defineProperty(exports, "getSassLoaderStandardSetup", {
151
151
  enumerable: true,
152
- get: function get() {
152
+ get: function () {
153
153
  return _sassLoader.getSassLoaderStandardSetup;
154
154
  }
155
155
  });
156
156
  Object.defineProperty(exports, "getTSLoaderStandardSetup", {
157
157
  enumerable: true,
158
- get: function get() {
158
+ get: function () {
159
159
  return _tsLoader.getTSLoaderStandardSetup;
160
160
  }
161
161
  });
162
162
  Object.defineProperty(exports, "getWebpackBundleAnalyzerStandardSetup", {
163
163
  enumerable: true,
164
- get: function get() {
164
+ get: function () {
165
165
  return _webpackBundleAnalyzer.getWebpackBundleAnalyzerStandardSetup;
166
166
  }
167
167
  });
168
168
  Object.defineProperty(exports, "getWebpackCommonSetup", {
169
169
  enumerable: true,
170
- get: function get() {
170
+ get: function () {
171
171
  return _commonSetup.getWebpackCommonSetup;
172
172
  }
173
173
  });
174
174
  Object.defineProperty(exports, "getWebpackDevelopmentSetup", {
175
175
  enumerable: true,
176
- get: function get() {
176
+ get: function () {
177
177
  return _developmentSetup.getWebpackDevelopmentSetup;
178
178
  }
179
179
  });
180
180
  Object.defineProperty(exports, "getWebpackManifestPluginStandardSetup", {
181
181
  enumerable: true,
182
- get: function get() {
182
+ get: function () {
183
183
  return _webpackManifestPlugin.getWebpackManifestPluginStandardSetup;
184
184
  }
185
185
  });
186
186
  Object.defineProperty(exports, "getWebpackProductionSetup", {
187
187
  enumerable: true,
188
- get: function get() {
188
+ get: function () {
189
189
  return _productionSetup.getWebpackProductionSetup;
190
190
  }
191
191
  });
@@ -6,14 +6,15 @@ export declare function getBabelLoaderAdvancedSetup(): {
6
6
  options: {
7
7
  presets: (string | (string | {
8
8
  modules: boolean;
9
- useBuiltIns: string;
10
- corejs: string;
11
9
  targets: {
12
10
  browsers: string[];
13
11
  };
14
12
  })[])[];
15
13
  plugins: (string | (string | {
16
14
  runtime: string;
15
+ })[] | (string | {
16
+ method: string;
17
+ version: string;
17
18
  })[])[];
18
19
  };
19
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"babelLoader.d.ts","sourceRoot":"","sources":["../../../src/webpack/loader/babelLoader.ts"],"names":[],"mappings":"AAGA,wBAAgB,2BAA2B;;;;;;;;;;;;;;;;;;;EAiC1C"}
1
+ {"version":3,"file":"babelLoader.d.ts","sourceRoot":"","sources":["../../../src/webpack/loader/babelLoader.ts"],"names":[],"mappings":"AAIA,wBAAgB,2BAA2B;;;;;;;;;;;;;;;;;;;;EAkC1C"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBabelLoaderAdvancedSetup = getBabelLoaderAdvancedSetup;
7
+ var _package = require("core-js/package.json");
7
8
  var _constant = require("../constant");
8
9
  // https://github.com/babel/babel-loader
9
10
 
@@ -16,15 +17,19 @@ function getBabelLoaderAdvancedSetup() {
16
17
  options: {
17
18
  presets: [['@babel/preset-env', {
18
19
  modules: false,
19
- useBuiltIns: 'entry',
20
- corejs: _constant.coreJSVersion,
21
20
  targets: {
22
21
  browsers: Object.values(_constant.targetBrowsers.modernBrowsers)
23
22
  }
24
23
  }], '@babel/preset-react', '@babel/preset-typescript'],
25
24
  plugins: [['@babel/plugin-transform-react-jsx', {
26
25
  runtime: 'automatic'
27
- }], '@babel/plugin-transform-runtime', 'syntax-async-functions']
26
+ }], '@babel/plugin-transform-runtime', 'syntax-async-functions',
27
+ // https://babeljs.io/docs/babel-preset-env#usebuiltins
28
+ // Babel 8 removed useBuiltIns/corejs from preset-env; babel-plugin-polyfill-corejs3 replaces it.
29
+ ['polyfill-corejs3', {
30
+ method: 'usage-global',
31
+ version: _package.version
32
+ }]]
28
33
  }
29
34
  }
30
35
  };