Created
July 11, 2018 16:29
-
-
Save mxmzb/f476f81884676897d0059a6865fde1f4 to your computer and use it in GitHub Desktop.
babel-jest in a monorepo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// .babelrc in packages/foodloc-models/.babelrc | |
{ | |
"presets": ["env", "react"], | |
"plugins": [ | |
"@babel/plugin-syntax-dynamic-import", | |
"@babel/plugin-transform-modules-commonjs", | |
"@babel/plugin-transform-runtime", | |
"@babel/plugin-proposal-export-default-from" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jest.config.js in root | |
module.exports = { | |
verbose: true, | |
bail: true, | |
transform: { "^.+\\.jsx?$": "babel-jest" }, | |
// moduleFileExtensions: ["js", "jsx"], | |
// modulePaths: ["<rootDir>/packages/foodloc-models"], | |
// projects: ["<rootDir>/packages/foodloc-models"], | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// package.json in root | |
{ | |
"name": "foodloc", | |
"private": true, | |
"version": "0.1.2", | |
"devDependencies": { | |
"@babel/cli": "^7.0.0-beta.52", | |
"@babel/core": "^7.0.0-beta.52", | |
"@babel/node": "^7.0.0-beta.52", | |
"@babel/plugin-proposal-export-default-from": "^7.0.0-beta.52", | |
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.52", | |
"@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.52", | |
"@babel/plugin-transform-runtime": "^7.0.0-beta.52", | |
"@babel/preset-env": "^7.0.0-beta.52", | |
"@babel/register": "^7.0.0-beta.52", | |
"babel-core": "^7.0.0-bridge.0", | |
"babel-eslint": "^8.2.5", | |
"babel-jest": "^23.4.0", | |
"babel-loader": "^8.0.0-beta.4", | |
"chalk": "^2.4.1", | |
"eslint": "^5.1.0", | |
"eslint-config-airbnb": "^17.0.0", | |
"eslint-config-airbnb-base": "^12.1.0", | |
"eslint-config-universe": "^1.0.7", | |
"eslint-plugin-import": "^2.13.0", | |
"eslint-plugin-jsx-a11y": "^6.1.0", | |
"eslint-plugin-react": "^7.10.0", | |
"jest": "^23.4.0", | |
"lerna": "^3.0.0-beta.21", | |
"node-sass-chokidar": "^1.3.0", | |
"nodemon": "^1.17.5", | |
"prettier": "^1.13.7", | |
"prettier-eslint": "^8.8.2", | |
"raw-loader": "^0.5.1", | |
"source-map-explorer": "^1.5.0" | |
}, | |
"scripts": { | |
"bootstrap": "yarn install && lerna bootstrap", | |
"start-api": "lerna exec --scope @foodloc/api -- yarn start", | |
"start-api-dev": "nodemon packages/foodloc-api/src/index.js --exec babel-node --presets @babel/env -e graphql,js", | |
"start-admin": "lerna exec --scope @foodloc/admin -- yarn start", | |
"start-app": "lerna exec --scope @foodloc/app -- yarn start", | |
"build-models": "lerna exec --scope @foodloc/models -- yarn build", | |
"test": "NODE_ENV=test jest --watchAll --notify --no-cache" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment