Skip to content

Commit

Permalink
Configured babel plugin for removing data-test from production code (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-stasiak-polidea authored and auxten committed Nov 20, 2020
1 parent 4e1aefa commit 94d9de0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions superset-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,15 @@ module.exports = {
instrumented: {
plugins: ['istanbul'],
},
production: {
plugins: [
[
'babel-plugin-jsx-remove-data-test-id',
{
attributes: 'data-test',
},
],
],
},
},
};
6 changes: 6 additions & 0 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"cover": "NODE_ENV=test jest --coverage",
"dev": "webpack --mode=development --colors --debug --watch",
"dev-server": "NODE_ENV=development BABEL_ENV=development node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development",
"prod": "node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --mode=production --colors",
"prod": "node --max_old_space_size=4096 BABEL_ENV=production ./node_modules/webpack/bin/webpack.js --mode=production --colors",
"build-dev": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=development webpack --mode=development --colors",
"build-instrumented": "cross-env NODE_ENV=development BABEL_ENV=instrumented webpack --mode=development --colors",
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors",
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV=production webpack --mode=production --colors",
"lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx,.ts,.tsx . && npm run type",
"prettier-check": "prettier --check '{src,stylesheets}/**/*.{css,less,sass,scss}'",
"lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx,.ts,tsx . && npm run clean-css && npm run type",
Expand Down Expand Up @@ -223,6 +223,7 @@
"babel-loader": "^8.0.6",
"babel-plugin-dynamic-import-node": "^2.3.0",
"babel-plugin-emotion": "^10.0.29",
"babel-plugin-jsx-remove-data-test-id": "^2.1.3",
"babel-plugin-lodash": "^3.3.4",
"cache-loader": "^1.2.2",
"clean-webpack-plugin": "^3.0.0",
Expand Down

0 comments on commit 94d9de0

Please sign in to comment.