Free your mind of the babel and the packed web

ember-cli-storybook and storybook itself has progressed to the point
where the DIY configs aren't necessary. It's all swept under the
`framework: '@storybook/ember'` config in main.js. Yay!
This commit is contained in:
Michael Lange
2023-06-13 23:05:07 -07:00
parent d6c1813ad5
commit d394aca551
3 changed files with 4 additions and 68 deletions

View File

@@ -1,53 +0,0 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
/* eslint-env node */
const templateCompiler = require('ember-source/dist/ember-template-compiler');
module.exports = {
presets: [
[
'@babel/preset-env',
{
shippedProposals: true,
useBuiltIns: 'usage',
corejs: '3',
targets: [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions',
],
},
],
],
plugins: [
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-syntax-dynamic-import',
[
'@babel/plugin-proposal-object-rest-spread',
{ loose: true, useBuiltIns: true },
],
'babel-plugin-macros',
['emotion', { sourceMap: true, autoLabel: true }],
[
'babel-plugin-htmlbars-inline-precompile',
{
precompile: templateCompiler.precompile,
modules: {
'ember-cli-htmlbars': 'hbs',
'ember-cli-htmlbars-inline-precompile': 'default',
'htmlbars-inline-precompile': 'default',
},
},
],
],
};

View File

@@ -5,6 +5,7 @@
/* eslint-env node */
module.exports = {
framework: '@storybook/ember',
addons: [
'@storybook/addon-docs',
'@storybook/addon-storysource',
@@ -16,4 +17,7 @@ module.exports = {
'../stories/components/*.stories.js',
'../stories/charts/*.stories.js',
],
core: {
builder: '@storybook/builder-webpack4',
},
};

View File

@@ -1,15 +0,0 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
/* eslint-env node */
module.exports = function ({ config }) {
config.module.rules.push({
test: /\.stories\.jsx?$/,
loaders: [require.resolve('@storybook/source-loader')],
enforce: 'pre',
});
return config;
};