Monday, April 8, 2019

AEM build core java classes and install bundle command

mvn install -PautoInstallBundle -Padobe-public

Wednesday, March 13, 2019

AEM build a maven based project

mvn -PautoInstallPackage -Padobe-public clean install

Note: Adding -Padobe-public parameter in order to install dependencies found in Adobe repositories
If these repositories are found in the corporate local artifactory, then no need to add this parameter

Tuesday, March 12, 2019

Webpack config changes to avoid random chunks names


In React-scripts created project, extract the webpack.config.js via running "react-script eject"

Update react.config.js:
- Find new MiniCssExtractPlugin(..) and delete "[contenthash:8]"
- Find output.filename and output.chunkFilename and delete "[contenthash:8]"
- Set optimization.runtimeChunk to false to avoid inline JavaScript inside index.html

Monday, March 11, 2019

Webpack App dev server proxy configuration

{
  "name": "app-name",
  "version": "0.1.0",
  "private": true,
  "homepage": "https://mywebsite.com/path/to/the/app",
  "dependencies": {
    "axios": "^0.18.0",
    "prop-types": "^15.6.1",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-ga": "^2.4.1",
    "react-scripts": "1.1.1",
    "react-transition-group": "^1.2.1"
  },
  "scripts": {
    "start-js": "react-scripts start",
    "start": "npm-run-all -p watch-css start-js",
    "build": "npm run build-css & react-scripts build && rm -rf docs && mv build output",
    "build-css": "node-sass-chokidar src/ -o src/",
    "watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recusive",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "serve": "webpack-dev-server --open"
  },
  "devDependencies": {
    "node-sass-chokidar": "^1.2.0",
    "npm-run-all": "^4.1.2"
  },
  "proxy": {
    "/path/to/my/apis": {
      "target": "https://apis.mydomain.com",
      "secure": false,
      "headers": {
        "host": "apis.mydomain.com",
        "Accept": "application/json"
      }
    }
  }
}