storybook/.babelrc.js

109 lines
2.9 KiB
JavaScript
Raw Normal View History

const withTests = {
presets: [
[
'@babel/preset-env',
{ shippedProposals: true, useBuiltIns: 'usage', corejs: '3', targets: { node: 'current' } },
],
],
plugins: [
'babel-plugin-require-context-hook',
'babel-plugin-dynamic-import-node',
'@babel/plugin-transform-runtime',
],
};
2018-11-09 09:46:31 +01:00
module.exports = {
2019-11-14 18:43:44 +08:00
ignore: [
'./lib/codemod/src/transforms/__testfixtures__',
'./lib/postinstall/src/__testfixtures__',
],
presets: [
2019-04-26 17:46:58 +02:00
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }],
2018-12-28 01:39:01 +01:00
'@babel/preset-typescript',
'@babel/preset-react',
'@babel/preset-flow',
],
2018-11-09 09:46:31 +01:00
plugins: [
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
2019-01-05 22:15:03 +01:00
['@babel/plugin-proposal-class-properties', { loose: true }],
2018-11-09 09:46:31 +01:00
'@babel/plugin-proposal-export-default-from',
2018-11-30 17:43:33 +01:00
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-proposal-object-rest-spread', { loose: true, useBuiltIns: true }],
2018-11-30 17:43:33 +01:00
'babel-plugin-macros',
Merge branch 'next' into tech/overhaul-ui # Conflicts: # .babelrc.js # addons/a11y/package.json # addons/actions/package.json # addons/backgrounds/package.json # addons/cssresources/package.json # addons/events/package.json # addons/graphql/package.json # addons/info/package.json # addons/info/src/components/PropTable.js # addons/jest/package.json # addons/knobs/package.json # addons/links/package.json # addons/notes/package.json # addons/ondevice-backgrounds/package.json # addons/options/package.json # addons/storyshots/storyshots-core/package.json # addons/storyshots/storyshots-puppeteer/package.json # addons/storysource/package.json # app/angular/package.json # app/ember/package.json # app/html/package.json # app/marko/package.json # app/mithril/package.json # app/polymer/package.json # app/react/package.json # app/riot/package.json # app/svelte/package.json # app/vue/package.json # examples/official-storybook/stories/addon-a11y.stories.js # examples/official-storybook/stories/addon-actions.stories.js # lib/addons/package.json # lib/channel-postmessage/package.json # lib/channel-websocket/package.json # lib/components/package.json # lib/components/src/layout/mobile.js # lib/core/package.json # lib/core/src/server/common/babel.js # lib/ui/package.json # lib/ui/src/modules/ui/components/stories_panel/index.js # lib/ui/src/modules/ui/components/stories_panel/stories_tree/index.test.js # lib/ui/src/modules/ui/components/stories_panel/stories_tree/tree_decorators_utils.js # lib/ui/src/modules/ui/components/stories_panel/text_filter.js # yarn.lock
2018-12-06 16:49:52 +01:00
['emotion', { sourceMap: true, autoLabel: true }],
2018-11-09 09:46:31 +01:00
],
env: {
test: withTests,
2018-11-09 09:46:31 +01:00
},
overrides: [
{
test: './examples/vue-kitchen-sink',
2018-12-04 13:26:34 +01:00
presets: ['babel-preset-vue'],
env: {
test: withTests,
},
2018-11-09 09:46:31 +01:00
},
{
test: './lib',
presets: [
2019-04-26 17:46:58 +02:00
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }],
'@babel/preset-react',
],
plugins: [
['@babel/plugin-proposal-object-rest-spread', { loose: true, useBuiltIns: true }],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-proposal-class-properties', { loose: true }],
'babel-plugin-macros',
['emotion', { sourceMap: true, autoLabel: true }],
'@babel/plugin-transform-react-constant-elements',
'babel-plugin-add-react-displayname',
],
env: {
test: withTests,
},
},
2018-11-09 09:46:31 +01:00
{
test: [
'./lib/node-logger',
'./lib/codemod',
'./addons/storyshots',
'**/src/server/**',
'**/src/bin/**',
2018-11-09 09:46:31 +01:00
],
presets: [
[
'@babel/preset-env',
{
2018-12-04 16:27:02 +01:00
shippedProposals: true,
useBuiltIns: 'usage',
2018-11-09 09:46:31 +01:00
targets: {
node: '8.11',
},
2019-04-26 17:46:58 +02:00
corejs: '3',
2018-11-09 09:46:31 +01:00
},
],
],
2019-01-05 22:15:03 +01:00
plugins: [
2019-03-02 21:00:28 +01:00
'emotion',
2019-01-05 22:15:03 +01:00
'babel-plugin-macros',
2020-04-02 23:22:04 +02:00
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-transform-shorthand-properties',
'@babel/plugin-transform-block-scoping',
'@babel/plugin-transform-destructuring',
2019-01-05 22:15:03 +01:00
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-default-from',
],
env: {
test: withTests,
},
2018-11-09 09:46:31 +01:00
},
],
};