Skip to content

Commit

Permalink
fix(mc-scripts): add babel plugin do-expressions to default vite conf…
Browse files Browse the repository at this point in the history
…ig (#2903)

* fix(mc-scripts): add babel plugin do-expressions to default vite config

* fix: formatting
  • Loading branch information
emmenko authored Dec 4, 2022
1 parent 84e985e commit 3d46e9f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-terms-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/mc-scripts': patch
---

Add `@babel/plugin-proposal-do-expressions` plugin to Vite config
8 changes: 7 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"trailingComma": "es5",
"singleQuote": true,
"parser": "typescript",
"parser": "babel",
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"options": {
"parser": "typescript"
}
},
{
"files": "*.json",
"options": {
Expand Down
5 changes: 4 additions & 1 deletion packages/mc-scripts/src/commands/build-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ async function run() {
pluginReact({
jsxImportSource: '@emotion/react',
babel: {
plugins: ['@emotion/babel-plugin'],
plugins: [
'@emotion/babel-plugin',
'@babel/plugin-proposal-do-expressions',
],
},
}),
pluginSvgr(),
Expand Down
5 changes: 4 additions & 1 deletion packages/mc-scripts/src/commands/start-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ async function run() {
pluginReact({
jsxImportSource: '@emotion/react',
babel: {
plugins: ['@emotion/babel-plugin'],
plugins: [
'@emotion/babel-plugin',
'@babel/plugin-proposal-do-expressions',
],
},
}),
pluginSvgr(),
Expand Down
4 changes: 2 additions & 2 deletions playground/src/components/entry-point/entry-point.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import configureApolloClient from '../../apollo-client';
// Here we split up the main (app) bundle with the actual application business logic.
// Splitting by route is usually recommended and you can potentially have a splitting
// point for each route. More info at https://reactjs.org/docs/code-splitting.html
const AsyncPlaygroundRoutes = lazy(
() => import('../../routes' /* webpackChunkName: "app-kit-playground" */)
const AsyncPlaygroundRoutes = lazy(() =>
import('../../routes' /* webpackChunkName: "app-kit-playground" */)
);

// Ensure to setup the global error listener before any React component renders
Expand Down

1 comment on commit 3d46e9f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for merchant-center-application-kit ready!

✅ Preview
https://merchant-center-application-m6knn6871-commercetools.vercel.app

Built with commit 3d46e9f.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.