react-scripts

How can I make `react-scripts build` quiet?

拟墨画扇 提交于 2020-08-27 08:59:08
问题 I am working with a repo with a number of Node packages created with create-react-app , all of which are built and tested by the CI system. Each package's build/test, done with react-scripts build followed by react-scripts test --silent , is currently producing over twenty lines of output resulting in a build log with well over a hundred lines of material such as "File sizes after gzip" and "Find out more about deployment here." This makes it more difficult to see error messages, warnings or

How stop after running react-scripts start?

[亡魂溺海] 提交于 2020-06-09 11:13:26
问题 I started a React app with npm start with start defined in package.json: { "name": "testreactapp", "version": "0.1.0", "private": true, "dependencies": { "react": "^15.6.1", "react-dom": "^15.6.1", "react-scripts": "1.0.10" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" } } I want to stop it now, without closing the terminal. How do I do that? Tried: npm stop testrectapp but that throws

React Typescript: Line 0: Parsing error: Cannot read property 'name' of undefined

安稳与你 提交于 2020-05-14 16:22:28
问题 Today suddenly I started to get build errors on a project built with Typescript. In a file that (or anything it references) hasn't been changed in weeks, I started to get: ./path/to/my/file.ts Line 0: Parsing error: Cannot read property 'name' of undefined This error first appeared on our CI, could be replicated by manually building on the server, and I could finally reproduce on my own computer (which was running perfectly) after updating all packages. Now, even if I pull the old (building)

Issue with babel-jest dependency when running npm start in a React app

那年仲夏 提交于 2020-02-26 12:07:07
问题 All I am doing is running create-react-app and cd'ing into the app, then trying to run npm/yarn start . I get the following error/output/log. I have walked through all of the suggested steps. The only thing that works is the SKIP_PREFLIGHT_CHECK=true in my .env as the last resort for both Yarn and npm. I have recently updated to Mojave and had to reinstall my Xcode if people have had a similar experience. If the image isn't sufficient, I pasted the output below. Thanks so much for your help

How to manually configure a minimal setup for React without create-react-app?

有些话、适合烂在心里 提交于 2020-01-05 03:43:28
问题 I do not want to use create-react-app . So how can I configure a minimal working dev environment for a simple react app? Note: I know I could likely just include everything at runtime as JS (that is well documented), but I do not want this, as I still want a version that is usable for production ! I do not want: to have any minification (see related question here) to have any concatenation (or, if it is easier to do, I may have all JS e.g. concatenated in a file) any older browser support

How to build a production version of React without minification?

房东的猫 提交于 2019-12-30 04:48:05
问题 Background I've been following more or less the official guide to setup a local dev environment with react and it seems to use create-react-app , which sets up really a lot. Now, if I run npm run build I get a minified version of everything in the build folder. If I, however, run npm start the version NodeJS serves does not seem to have any modifications. But I cannot see these files. Question So either: Can I access the files generated by npm start somewhere? As these seem to be unmodified.

How to unit test reduxsauce?

邮差的信 提交于 2019-12-10 21:47:49
问题 I am using reduxsauce library for redux store, and I want to unit test a single redux store in it. The redux file: import { createReducer, createActions } from 'reduxsauce' import Immutable from 'seamless-immutable' /* ------------- Types and Action Creators ------------- */ const { Types, Creators } = createActions({ getLanguage: [], setLanguage: ['language'] }) export const LanguageTypes = Types export default Creators /* ------------- Initial State ------------- */ export const INITIAL

Relative path in index.html after build

本小妞迷上赌 提交于 2019-12-09 14:14:39
问题 Hello i have a reactjs app, and I build my project with bellow command npm build Here is my package.json file: "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject"}, after build i have folder with build files and index.html file But all paths in this .html are absolute, i want to build with relative path for example (index.html): now i have: <script type="text/javascript" src="/static/js/main

Tree shaking create-react-app?

為{幸葍}努か 提交于 2019-12-06 20:49:28
问题 I created my React app with create-react-app and now use TypeScript with create-react-app-typescript. Everything works ok, but the problem is - especially because I use the good but heavy material-ui - the size of the built bundle is quite big - almost reaching 1MB. How can I use tree shaking tools (like in Webpack 2 or rollup? I don't want to eject already so seems like I don't really have access to the Webpack configuration. I wish it was possible to tree shake a minified code :) Thanks!

How do I change `src` folder to something else in create-react-app

孤人 提交于 2019-12-03 11:09:30
问题 I'd like to know if it's possible using react-script to rename src to something else like app folder 回答1: You can use react-app-rewired to override react paths configuration. In my case, I can change the paths in config-overrides.js file const path = require('path'); module.exports = { paths: function (paths, env) { paths.appIndexJs = path.resolve(__dirname, 'mysrc/client.js'); paths.appSrc = path.resolve(__dirname, 'mysrc'); return paths; }, } 回答2: I know this is an old question but I'm