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

Add plugin to delete data-test attributes from production build #237

Open
paleika opened this issue Dec 30, 2020 · 0 comments
Open

Add plugin to delete data-test attributes from production build #237

paleika opened this issue Dec 30, 2020 · 0 comments
Labels
configuration Project workflow configuration
Milestone

Comments

@paleika
Copy link
Contributor

paleika commented Dec 30, 2020

There is a plugin for that:
"babel-plugin-react-remove-properties": "^0.3.0",

babelrc should contain it's settings:

  "plugins": [
    <...>,
    [
      "react-remove-properties",
      {"properties": ["data-test"]}
    ]
  ]

babelrc should have different configs for different environments:

{
  "env": {
    "dev": {
      "presets": [],
      "plugins": []
    },
    "test": {
      "presets": [],
      "plugins": []
    }
  }
}

and the env is set in webpack.js

{
  "loader": "babel-loader",
  "options": {
    "envName": 'yourEnvironmentName'
  }
}
@paleika paleika added the configuration Project workflow configuration label Dec 30, 2020
@paleika paleika added this to the Testing milestone Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Project workflow configuration
Projects
None yet
Development

No branches or pull requests

1 participant