Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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