I've had this problem for a while, I use the npm run-script build command to build the project and generate the artifact. The project is in React, and depends on umi.
umirc.js:
// ref: http://umijs.org/config/
import webpackConfig from './plugin.config.js'
export default {
exportStatic: {},
chainWebpack: webpackConfig,
sass: {},
treeShaking: true,
theme: {
'primary-color': '#1976D2',
'text-color': ' rgba(0, 0, 0, 0.85)',
},
plugins: [
// ref: http://umijs.org/plugin/umi-plugin-react.html
[
'umi-plugin-react',
{
antd: true,
dva: false,
title: 'my-app',
dll: true,
locale: {
enable: true,
default: 'pt-BR',
},
routes: {
exclude: [
/tabs\//,
/modals\//,
/components\//,
/context\//,
/utils\//,
/enums/,
// modules
///Assets\//,
/ComponentTest/,
///Contract\//,
///Notification\//,
///InvoiceManagement\//,
/financial\//,
///Licensing\//,
///Log\//,
///MaterialRequest\//,
/modalsExamples\//,
///Network\//,
///OccurrenceRoutine\//,
/pdfExamples\//,
///Permissions\//,
///Registration\//,
///Services\//,
// /Schedule\//,
///Purchase\//,
///Person\//,
// /Region\//,
///ServiceOrder\//,
///DocumentGenerator\//,
],
},
// dynamicImport: {},
},
],
],
}
package.json:
{
"private": true,
"scripts": {
"predevelop": "tailwind build ./src/tailwind.css -c ./tailwind.config.js -o ./src/index.css",
"prebuild": "tailwind build ./src/tailwind.css -c ./tailwind.config.js -o ./src/index.css",
"develop": "umi dev",
"build": "umi build",
"test": "umi test --coverage --watchAll=true",
"test:watch": "jest --watch",
"lint-staged": "lint-staged",
"lint": "eslint --ext .jsx --ext .js src --fix"
},
"dependencies": {
"#ant-design/compatible": "^1.0.2",
"#ant-design/icons": "^4.4.0",
"#antv/data-set": "^0.10.2",
"#david.kucsai/react-pdf-table": "^0.1.1",
"#fnando/cpf": "^0.1.1",
"#khanacademy/react-multi-select": "^0.3.3",
"#react-mock/localstorage": "^0.1.2",
"#react-pdf/renderer": "^1.6.8",
"#softin/person": "^1.0.8",
"#testing-library/jest-dom": "^5.11.9",
"#testing-library/react": "^9.4.0",
"#use-it/interval": "^0.1.3",
"antd": "^4.18.8",
"axios": "^0.26.0",
"axios-mock-adapter": "^1.17.0",
"bizcharts": "^3.5.9",
"constate": "^2.0.0",
"draftjs-to-html": "^0.9.1",
"ignore-case": "^0.1.0",
"image-to-base64": "^2.0.1",
"immutability-helper": "^3.0.2",
"leaflet": "^1.6.0",
"moment": "^2.24.0",
"moment-timezone": "^0.5.27",
"pdfmake": "^0.1.70",
"prop-types": "^15.7.2",
"query-string": "^6.13.8",
"randomcolor": "^0.6.2",
"rc-tween-one": "^2.6.8",
"react": "^16.13.1",
"react-big-calendar": "^0.23.0",
"react-data-export": "^0.5.0",
"react-dnd": "latest",
"react-dnd-html5-backend": "latest",
"react-dom": "^16.13.1",
"react-draft-wysiwyg": "^1.14.4",
"react-drag-listview": "^0.1.8",
"react-input-mask": "^2.0.4",
"react-leaflet": "^2.6.1",
"react-number-format": "^4.4.4",
"react-responsive": "^8.2.0",
"react-router-breadcrumbs-hoc": "^3.3.1",
"react-select": "^3.2.0",
"react-sortable-tree": "^2.7.1",
"react-sortable-tree-theme-full-node-drag": "^1.1.0",
"reqwest": "^2.0.5",
"tailwindcss": "^1.1.4",
"umi": "^2.13.17",
"umi-plugin-react": "^1.15.2",
"wait-for-expect": "^3.0.1",
"with-wrapper": "^1.0.1",
"xlsx": "^0.18.2"
},
"devDependencies": {
"#testing-library/user-event": "^13.1.9",
"babel-eslint": "^10.0.3",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.10.0",
"eslint-config-umi": "^1.6.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-flowtype": "^4.6.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-jest": "^23.6.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^2.3.0",
"husky": "^4.3.8",
"lint-staged": "^10.5.3",
"react-test-renderer": "^16.12.0"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint-staged"
}
},
"engines": {
"node": ">=8.0.0"
},
"lint-staged": {
"*.{js,jsx}": [
"eslint --fix",
"git add"
]
},
"bit": {
"env": {},
"componentsDefaultDirectory": "components/{name}",
"packageManager": "npm"
}
}
In umirc.js you get the exportStatic where they are also generated in html file formats in each of the folders, there are several subprojects, but it is generating part of it, each subproject is in the file routes, I need to generate it completely. Could anyone help me with this?
Related
I'm using Typescript with Vue3 (vite). It's working fine in the <script lang="ts" setup> tag. But in my template I do not get any auto-suggestions and the types do not work.
For example (see red lines):
In my script tag the types are working (no errors!).
I'm using the vue volar plugin.
tsconfig.vite-config.json:
{
"extends": "#vue/tsconfig/tsconfig.node.json",
"include": ["vite.config.*", "src/plugins/**/*.ts"],
"compilerOptions": {
"composite": true,
"types": ["node"]
}
}
Package.json:
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"#inertiajs/inertia": "^0.11.0",
"#inertiajs/inertia-vue3": "^0.6.0",
"#inertiajs/progress": "^0.2.7",
"#tailwindcss/forms": "^0.5.3",
"#tailwindcss/typography": "^0.5.8",
"#vitejs/plugin-vue": "^3.0.0",
"autoprefixer": "^10.4.12",
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.0",
"lodash": "^4.17.19",
"postcss": "^8.4.18",
"tailwindcss": "^3.2.1",
"vite": "^3.0.0",
"vue": "^3.2.41"
},
"dependencies": {
"#heroicons/vue": "^2.0.13",
"#typescript-eslint/eslint-plugin": "^5.46.0",
"#typescript-eslint/parser": "^5.46.0",
"#vue/tsconfig": "^0.1.3",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-vue": "^9.8.0",
"lint-staged": "^13.1.0",
"prettier": "^2.8.1",
"prettier-plugin-tailwindcss": "^0.2.1",
"typescript": "^4.9.4",
"uuid": "^9.0.0",
"vue-toastification": "^2.0.0-rc.5"
}
}
What can be wrong here?
While trying to start the project I have the following error:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'C:\Users\user\Documents\signatura-web\node_modules#babel\preset-es2015' imported from C:\Users\user\Documents\signatura-web\babel-virtual-resolve-base.js.
I have #babel packages installed (7th version) and babel-loader (8th version).
Here is package.json file:
{
"name": "signatura-web",
"version": "1.0.0",
"description": "",
"private": true,
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --open --mode development --env dev",
"build": "webpack --mode production --env stage",
"build:prod": "webpack --mode production --env prod",
"serve": "node prodServer.js",
"test": "jest"
},
"repository": {
"type": "git",
"url": "https://Evgeny.Smirennikov#bitbucket.axamit.com/scm/sgt/signatura-web.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"#babel/core": "^7.10.3",
"#babel/plugin-proposal-class-properties": "^7.10.4",
"#babel/plugin-transform-runtime": "^7.11.5",
"#babel/preset-env": "^7.10.3",
"#babel/preset-es2015": "^7.0.0-beta.53",
"#babel/preset-react": "^7.10.1",
"#babel/preset-typescript": "^7.12.7",
"#svgr/webpack": "^5.4.0",
"#types/react-datepicker": "^4.3.3",
"#types/react-notifications-component": "^2.4.0",
"#types/react-redux": "^7.1.11",
"#types/react-router-dom": "^5.3.2",
"#types/yup": "^0.29.13",
"#typescript-eslint/eslint-plugin": "^5.12.1",
"#typescript-eslint/parser": "^5.12.1",
"babel-loader": "^8.1.0",
"copy-webpack-plugin": "^6.4.0",
"css-loader": "^3.6.0",
"eslint": "^8.21.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^6.0.4",
"html-loader": "^1.1.0",
"html-webpack-plugin": "^4.3.0",
"identity-obj-proxy": "^3.0.0",
"mini-css-extract-plugin": "^0.9.0",
"prettier": "^2.7.1",
"react-datetime": "2.16.3",
"react-router-redux": "^4.0.8",
"style-loader": "^1.2.1",
"stylus-loader": "^3.0.2",
"ts-loader": "^8.0.11",
"typescript": "^4.1.2",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"#beyonk/google-fonts-webpack-plugin": "^1.5.0",
"#hookform/resolvers": "^1.0.0",
"#logtail/browser": "^0.1.12",
"#material-ui/core": "^4.11.0",
"#material-ui/icons": "^4.9.1",
"#types/react-input-mask": "^3.0.1",
"animejs": "^3.2.1",
"axios": "^0.27.2",
"bootstrap": "^4.5.2",
"braintree-web-drop-in-react": "^1.2.1",
"classnames": "^2.2.6",
"compute-scroll-into-view": "^1.0.17",
"connected-react-router": "^6.8.0",
"copy-to-clipboard": "^3.3.1",
"date-fns": "^2.29.1",
"express": "^4.17.1",
"file-loader": "^6.1.0",
"font-awesome": "^4.7.0",
"google-map-react": "^2.1.9",
"headroom.js": "^0.11.0",
"html-react-parser": "^1.4.8",
"jest": "^26.6.3",
"moment": "^2.26.0",
"node-sass": "^4.14.1",
"openvidu-browser": "2.16.0",
"pdfjs-dist": "^3.0.279",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-addons-css-transition-group": "^15.6.2",
"react-bootstrap": "^1.3.0",
"react-bootstrap-typeahead": "^5.1.1",
"react-datepicker": "^4.5.0",
"react-document-meta": "^3.0.0-beta.2",
"react-dom": "^16.13.1",
"react-dropzone": "^11.1.0",
"react-ga": "^3.3.0",
"react-hook-form": "^6.9.6",
"react-input-mask": "^2.0.4",
"react-modal": "^3.11.2",
"react-notifications-component": "^2.4.1",
"react-paginate": "^6.5.0",
"react-progressive-graceful-image": "^0.6.14",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-select": "^3.1.0",
"react-spinners": "^0.9.0",
"react-string-replace": "^0.4.4",
"react-tabs": "^3.1.1",
"react-test-renderer": "^17.0.1",
"reactstrap": "^8.5.1",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-persist": "^6.0.0",
"redux-persist-transform-filter": "^0.0.20",
"redux-saga": "^1.1.3",
"regenerator-runtime": "^0.13.7",
"sass-loader": "^10.0.2",
"stylus": "^0.54.8",
"yup": "^0.29.3"
},
"homepage": "./",
"jest": {
"moduleNameMapper": {
"\\.(css|styl|svg)$": "identity-obj-proxy"
}
}
}
Here is .babelrc file:
{
"presets": [
"#babel/preset-env",
"#babel/preset-react",
"#babel/preset-typescript",
"#babel/preset-es2015"
],
"plugins": [
[
"#babel/plugin-proposal-class-properties"
]
]
}
Among rules in webpack.config.js I have:
{
test: /\.(js|jsx|tsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
I built the NPM package based on components written in React and Typescript.
Export that package as npm
Install package into another React with TS repo
Result: Error appear:
Failed to compile.
./node_modules/#nikolatrajkovic123/ec-general-section-form/HubSectionPack.tsx
10:5 Module parse failed: Unexpected token (10:5) You may need an
appropriate loader to handle this file type, currently no loaders are
configured to process this file. See
https://webpack.js.org/concepts#loaders | import
'./package-styles.scss'; |
type HubSectionPackProps = { | sectionName: SectionName; | // eslint-disable-next-line
Babel
{
"presets": ["#babel/preset-env", "#babel/preset-react", "env", "react"],
"plugins": ["transform-class-properties"]
}
Webpack:
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: {
main: './src/index.tsx',
},
module: {
rules: [
{
test: /\.(js|ts|tsx)$/,
loader: require.resolve('babel-loader'),
options: {
customize: require.resolve(
'babel-preset-react-app/webpack-overrides',
),
},
},
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
'style-loader',
// Translates CSS into CommonJS
'css-loader',
// Compiles Sass to CSS
'sass-loader',
],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.scss'],
},
plugins: [new webpack.CleanPlugin()],
output: {
filename: '[name].[contenthash].js',
path: path.join(__dirname, 'dist'),
},
};
Package.json of the package:
{
"name": "#nikolatrajkovic123/hub-section-form",
"version": "1.3.8",
"description": "Enrollment / Hub section form",
"main": "./index.ts",
"module": "./dist/index.es.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/Bestowinc/enrollment-client.git"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"author": "Direct Team",
"license": "MIT",
"dependencies": {
"#babel/polyfill": "^7.12.1",
"#bestowinc/bestow-logger": "1.0.26",
"#bestowinc/enroll-sdk-core": "^0.9.40",
"#bestowinc/kindred-ds": "^0.6.2",
"#hookform/resolvers": "^2.7.1",
"#sentry/minimal": "^6.14.1",
"#sentry/react": "^6.3.6",
"#sentry/tracing": "^6.3.6",
"#tailwindcss/postcss7-compat": "^2.0.2",
"#testing-library/jest-dom": "^5.15.0",
"#testing-library/react": "^12.1.2",
"#tippyjs/react": "^4.2.5",
"#types/react-slider": "^1.3.1",
"#types/uuid": "^8.3.1",
"#xstate/inspect": "^0.4.1",
"#xstate/react": "^1.3.1",
"auth0-js": "^9.16.4",
"autoprefixer": "^9",
"cleave.js": "^1.6.0",
"fast-glob": "^3.2.7",
"file-loader": "^6.2.0",
"ismobilejs": "^1.1.1",
"jest": "^26.6.3",
"jwt-decode": "^3.1.2",
"lodash.get": "^4.4.2",
"lodash.merge": "^4.6.2",
"lodash.noop": "^3.0.1",
"lodash.unset": "^4.5.2",
"path": "^0.12.7",
"postcss": "^8.3.11",
"postcss-loader": "^4.2.0",
"postcss-scss": "^3.0.4",
"react-hook-form": "^7.15.3",
"react-router-dom": "^5.2.0",
"react-slider": "^1.3.1",
"sass": "^1.32.7",
"styled-components": "^5.3.2",
"styled-system": "^5.1.5",
"tailwindcss": "npm:#tailwindcss/postcss7-compat",
"tippy.js": "^6.3.1",
"tsconfig": "^7.0.0",
"typescript": "^4.4.4",
"uuid": "^8.3.2",
"web-vitals": "^0.2.4",
"xstate": "^4.17.0",
"yup": "^0.32.9"
},
"devDependencies": {
"#babel/core": "^7.12.10",
"#babel/preset-env": "^7.16.4",
"#babel/preset-flow": "^7.16.0",
"#babel/preset-react": "^7.12.10",
"#babel/preset-typescript": "^7.16.0",
"#bestowinc/xray-test-util": "^1.1.4",
"#craco/craco": "^6.1.2",
"#rollup/plugin-babel": "^5.3.0",
"#rollup/plugin-commonjs": "^21.0.1",
"#rollup/plugin-json": "^4.1.0",
"#rollup/plugin-node-resolve": "^11.1.1",
"#rollup/plugin-replace": "^3.0.0",
"#rollup/plugin-url": "^6.1.0",
"#tailwindcss/postcss7-compat": "^2.0.2",
"#types/auth0-js": "^9.14.2",
"#types/chance": "^1.1.1",
"#types/cleave.js": "^1.4.4",
"#types/history": "4.7.9",
"#types/jest": "^26.0.19",
"#types/lodash.get": "^4.4.6",
"#types/lodash.merge": "^4.6.6",
"#types/lodash.noop": "^3.0.6",
"#types/lodash.pick": "^4.4.6",
"#types/node": "^12.19.9",
"#types/react": "^16.14.2",
"#types/react-dom": "^17.0.7",
"#types/react-router-dom": "^5.1.7",
"#types/react-slider": "^1.3.1",
"#types/segment-analytics": "^0.0.34",
"#types/styled-components": "^5.1.15",
"#types/styled-system": "^5.1.13",
"#types/uuid": "^8.3.0",
"#typescript-eslint/eslint-plugin": "^4.15.0",
"#typescript-eslint/parser": "^4.15.0",
"babel-loader": "8.1.0",
"babel-plugin-styled-components": "^1.13.3",
"chance": "^1.1.7",
"circle-github-bot": "^2.1.0",
"css-loader": "^5.0.2",
"cypress": "9.0.0",
"cypress-terminal-report": "^3.3.4",
"eslint": "^7.2.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^1.7.0",
"firebase-tools": "^9.10.2",
"husky": "^6.0.0",
"jsonwebtoken": "^8.5.1",
"luxon": "^1.26.0",
"mini-css-extract-plugin": "^1.3.6",
"neat-csv": "^6.0.1",
"pdf-parse": "^1.1.1",
"prettier": "2.2.1",
"progress-bar-webpack-plugin": "^2.1.0",
"react-scripts": "4.0.1",
"rollup": "^2.38.4",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-svg": "^2.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^3.0.1",
"rollup-plugin-url-resolve": "^0.2.0",
"sass-loader": "10.1.1",
"sinon": "^9.2.4",
"source-map-explorer": "^2.5.2",
"style-loader": "^2.0.0",
"typescript": "4.2.2"
},
"peerDependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"resolutions": {
"tslib": "2.3.1"
},
"external": [
"react",
"react-dom"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "rollup -c --watch",
"build": "rollup -c"
},
"bugs": {
"url": "https://github.com/issues"
},
"homepage": "https://github.com/readme"
}
Project was created with create-react-app. Did not eject. There are no webpack configs. Default "react-scripts": "^3.4.0". On dev version there is no error. But on production when user stays long on one page and clicks the link it shows white page, and after updating the site(deploying new version). This error randomly appears. Output on console
Unexpected token '<'
and no other information.
There is my package.json
{
"name": "project-name",
"version": "2.0.0",
"description": "description",
"private": true,
"dependencies": {
"#bugsnag/js": "^6.5.0",
"#bugsnag/plugin-react": "^6.5.0",
"#glidejs/glide": "^3.4.1",
"#material-ui/core": "^4.4.1",
"#sentry/browser": "^5.11.2",
"#sentry/cli": "^1.49.0",
"#types/jest": "^25.1.3",
"#types/node": "^13.7.4",
"#types/rc-switch": "^1.9.0",
"#types/react": "^16.9.22",
"#types/react-dom": "^16.9.5",
"axios": "^0.19.0",
"chart.js": "^2.9.1",
"classnames": "2.2.6",
"debounce-promise": "^3.1.2",
"formik": "^1.5.8",
"jquery": "^3.4.1",
"logrocket": "^1.0.6",
"logrocket-react": "^4.0.1",
"moment": "2.24.0",
"moment-timezone": "^0.5.27",
"orgchart": "^2.1.5",
"prop-types": "^15.7.2",
"purgecss": "^1.4.0",
"rc-switch": "^1.9.0",
"react": "^16.9.0",
"react-autosuggest": "^9.4.3",
"react-chartjs-2": "^2.7.6",
"react-circular-progressbar": "^2.0.2",
"react-contextmenu": "^2.11.0",
"react-data-export": "^0.6.0",
"react-datepicker": "^2.9.6",
"react-dom": "^16.9.0",
"react-dropzone-component": "^3.2.0",
"react-intl": "2.4.0",
"react-perfect-scrollbar": "^1.5.3",
"react-redux": "7.1.1",
"react-router-dom": "^5.0.1",
"react-scripts": "^3.4.0",
"react-select": "^3.0.4",
"react-select-async-paginate": "^0.3.10",
"react-table": "latest",
"react-transition-group": "^4.3.0",
"reactstrap": "^8.0.1",
"redux": "^4.0.4",
"redux-saga": "^1.0.5",
"styled-components": "^5.0.0",
"tailwindcss": "^1.1.2",
"typescript": "^3.8.2",
"xlsx": "^0.15.5",
"yup": "^0.27.0"
},
"scripts": {
"start": "yarn run tailwind && react-scripts start",
"build": "yarn run tailwind && node ./purge-tailwindcss.js && cross-env react-scripts build",
"tailwind": "./node_modules/.bin/tailwind build ./src/assets/css/vendor/tailwind.base.css -c ./tailwind.js -o ./src/assets/css/vendor/tailwind.css",
"test": "react-scripts test --env=node",
"crt": "bash create-component.sh",
"eject": "react-scripts eject",
"lint": "eslint src/**/*.js"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"babel-plugin-import": "^1.13.0",
"cross-env": "^5.2.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.18.0",
"eslint-plugin-react-hooks": "^1.7.0",
"node-sass": "^4.12.0",
}
}
Don't know how. But after enabling sourcemap this error doesn't shown.
I removed this command from yarn build:
GENERATE_SOURCEMAP=false
I am getting this after installing jest, and transform-decorators-legacy.
But jest is running successfully and passing tests for each screen.
I am using MOBX for stores.
bablerc file :
{
"presets": ["react-native","babel-preset-expo","react-native-
stage-0/decorator-support"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source","transform-decorators
-legacy"]
}
}
}
package.json
"scripts": {
"test": "node_modules/.bin/jest"
},
"jest": {
"preset": "jest-expo"
},
"author": null,
"private": true,
"main": "node_modules/expo/AppEntry.js",
"dependencies": {
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-native": "^4.0.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"expo": "^21.0.0",
"mobx": "^3.3.1",
"mobx-react": "^4.3.3",
"native-base": "^2.3.3",
"react": "16.0.0-alpha.12",
"react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",
"react-native-admob": "^2.0.0-beta.2",
"react-native-keyboard-aware-scroll-view": "^0.4.1",
"react-native-modal": "^4.1.0",
"react-native-prompt": "^1.0.0",
"react-navigation": "^1.0.0-beta.15"
},
"devDependencies": {
"babel-jest": "^21.2.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-native": "^4.0.0",
"cavy": "^0.4.1",
"jest": "^21.2.1",
"jest-expo": "^22.0.1-SNAPSHOT.2017.11.1",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"regenerator-runtime": "^0.11.0"
}
}