Netcentric / fe-build

All-in-one solution for modern Frontend projects, with special focus on AEM (Adobe Experience Manager)
Apache License 2.0
21 stars 7 forks source link

How to use with React #71

Closed quicoto closed 3 months ago

quicoto commented 2 years ago

Would be nice to document the minimal config changes needed to make this work with React or another framework

easingthemes commented 3 months ago

React example:

  1. disable clientlibs if it's non AEM application defaultTasks: ["styles", "webpack"],
  2. Install @babel/preset-react
  3. Add @babel/preset-react to babel config:
  general: {
    defaultTasks: ["styles", "webpack"],
  },
  babel: {
    use: {
      options: {
        presets: [
          "@babel/preset-env",
          "@babel/preset-react"
        ]
      }
    }
  },

This config was test on existing PROD React SPA.

quicoto commented 3 months ago

Thank you, closing issue