2020-01-21 21:46:32 +00:00
|
|
|
/* eslint-env node */
|
2021-02-25 00:11:49 +00:00
|
|
|
|
|
|
|
// Inject the named blocks polyfill into the template compiler (and then into the babel plugin)
|
|
|
|
const templateCompiler = require('ember-source/dist/ember-template-compiler');
|
|
|
|
const namedBlocksPolyfillPlugin = require('ember-named-blocks-polyfill/lib/named-blocks-polyfill-plugin');
|
|
|
|
|
|
|
|
templateCompiler.registerPlugin('ast', namedBlocksPolyfillPlugin);
|
|
|
|
|
2020-01-21 21:46:32 +00:00
|
|
|
module.exports = {
|
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
'@babel/preset-env',
|
|
|
|
{
|
|
|
|
shippedProposals: true,
|
|
|
|
useBuiltIns: 'usage',
|
|
|
|
corejs: '3',
|
2021-12-28 16:08:12 +00:00
|
|
|
targets: [
|
|
|
|
'last 1 Chrome versions',
|
|
|
|
'last 1 Firefox versions',
|
|
|
|
'last 1 Safari versions',
|
|
|
|
],
|
2020-01-21 21:46:32 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
[
|
|
|
|
'@babel/plugin-proposal-decorators',
|
|
|
|
{
|
|
|
|
legacy: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
['@babel/plugin-proposal-class-properties', { loose: true }],
|
|
|
|
'@babel/plugin-syntax-dynamic-import',
|
2021-12-28 16:08:12 +00:00
|
|
|
[
|
|
|
|
'@babel/plugin-proposal-object-rest-spread',
|
|
|
|
{ loose: true, useBuiltIns: true },
|
|
|
|
],
|
2020-01-21 21:46:32 +00:00
|
|
|
'babel-plugin-macros',
|
|
|
|
['emotion', { sourceMap: true, autoLabel: true }],
|
2021-02-25 00:11:49 +00:00
|
|
|
[
|
|
|
|
'babel-plugin-htmlbars-inline-precompile',
|
|
|
|
{
|
|
|
|
precompile: templateCompiler.precompile,
|
|
|
|
modules: {
|
|
|
|
'ember-cli-htmlbars': 'hbs',
|
|
|
|
'ember-cli-htmlbars-inline-precompile': 'default',
|
|
|
|
'htmlbars-inline-precompile': 'default',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// This is an arbitrary label to prevent a collision with the existing htmlbars inline precompile
|
|
|
|
// plugin that comes in from the @storybook/ember defaults.
|
|
|
|
// TODO: After upgrading to Storybook 6.1 this should move into the new emberOptions construct.
|
|
|
|
'override',
|
|
|
|
],
|
2020-01-21 21:46:32 +00:00
|
|
|
],
|
|
|
|
};
|