Skip to content

Commit

Permalink
feat: add config babelParserOpts (tajo#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckend authored Apr 26, 2022
1 parent 227c5c0 commit 2102752
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/ladle/lib/cli/vite-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const getBaseViteConfig = async (ladleConfig, configFolder, viteConfig) => {
//@ts-ignore
react({
babel: {
parserOpts: ladleConfig.babelParserOpts,
presets: ladleConfig.babelPresets,
plugins: ladleConfig.babelPlugins,
compact: true,
Expand Down
1 change: 1 addition & 0 deletions packages/ladle/lib/shared/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default {
publicDir,
enableFlow: false, // enable support for flow types
defaultStory: "", // default story id to load, alphabetical by default
babelParserOpts: {},
babelPresets: [],
babelPlugins: [],
vitePlugins: [],
Expand Down
1 change: 1 addition & 0 deletions packages/ladle/lib/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export type Config = {
publicDir: string | false;
enableFlow: boolean;
defaultStory: string;
babelParserOpts: { [key: string]: any };
babelPlugins: any[];
babelPresets: any[];
vitePlugins: VitePluginInput[];
Expand Down
5 changes: 3 additions & 2 deletions packages/website/docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ export default {
publicDir: "public", // can be an absolute path or `false` to disable the feature
enableFlow: false, // enable flow types support
defaultStory: "", // default story id to load, alphabetical by default
babelPresets: [],
babelPlugins: [],
babelParserOpts: {}, // https://babeljs.io/docs/en/babel-parser#options
babelPresets: [], // https://babeljs.io/docs/en/presets
babelPlugins: [], // https://babeljs.io/docs/en/plugins
vitePlugins: [], // https://vitejs.dev/config/#plugins
envPrefix: "VITE_", // can be a string or string[]
css: {
Expand Down

0 comments on commit 2102752

Please sign in to comment.