create-react-app

Create React App V2 - Multiple entry points

落花浮王杯 提交于 2020-12-29 03:48:05
问题 I'm trying to build a React app with 2 entry points, one for the App and one for the Admin panel. I'm starting with Create React App V2 and following this gitHub issue thread https://github.com/facebook/create-react-app/issues/1084 and this tutorial http://imshuai.com/create-react-app-multiple-entry-points/. I'm trying to port the instructions for adding multiple entry points from CRA V1 to work in V2 but I think I am missing something. After ejecting CRA, these are the paths I've changed

Getting error (0 , _schemaUtils.default) is not a function when running CRA on Docker

别来无恙 提交于 2020-12-15 05:21:06
问题 Update Fixed it by running rm -rf node_modules && rm -rf yarn.lock && yarn && docker-compose -f docker-compose.dev.yml up --build I'm having trouble running my app with Docker. Fist, I build the image, // build image $ docker-compose -f docker-compose.dev.yml up docker-compose.dev.yml : version: '3.8' services: print: stdin_open: true build: context: . dockerfile: Dockerfile.dev ports: - '3000:3000' volumes: - '.:/app' - '/app/node_modules' Dockerfile.dev : FROM node:alpine WORKDIR /app COPY

Why we need the --scripts-version command line option for create-react-app?

我只是一个虾纸丫 提交于 2020-12-15 05:20:41
问题 I am new to React and learning how to properly create new project. Then I came across --scripts-version when we create new project with such command: create-react-app new-project --scripts-version Why do we need to use --scripts-version ? 回答1: The tool create-react-app is basically a wrapper around a number of tools and configuration options stored in an npm package called react-scripts. When you use the create-react-app command to create your React app, it uses react-scripts to set up your

TypeError: (0 , _schemaUtils.default) is not a function

纵然是瞬间 提交于 2020-12-13 11:37:02
问题 I have a simple React app created with create-react-app that runs fine on localhost. I'm now trying to Dockerify the app. Here's my package.json: { "name": "yeet", "version": "0.1.0", "engines": { "node": "12.x" }, "scripts": { "client": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "start": "node server.js", "production": "npm run build && npm run start" }, "private": true, "dependencies": { "@testing-library/jest-dom": "

TypeError: (0 , _schemaUtils.default) is not a function

霸气de小男生 提交于 2020-12-13 11:35:35
问题 I have a simple React app created with create-react-app that runs fine on localhost. I'm now trying to Dockerify the app. Here's my package.json: { "name": "yeet", "version": "0.1.0", "engines": { "node": "12.x" }, "scripts": { "client": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "start": "node server.js", "production": "npm run build && npm run start" }, "private": true, "dependencies": { "@testing-library/jest-dom": "

Viewing NodeJS projects on other devices in the network

一曲冷凌霜 提交于 2020-12-06 05:16:56
问题 I’m trying to view a CreateReactApp project from a different device. I tried setting the host to 0.0.0.0 by setting the “start” script to: "start": "cross-env HOST=0.0.0.0 react-scripts start". Though the console did log Attempting to bind to HOST environment variable: 0.0.0.0 If this was unintentional, check that you haven't mistakenly set it in your shell. Learn more here: [URL BLOCKED BY GITHUB]. I could not access this project from another device on the same network using the computer’s

Viewing NodeJS projects on other devices in the network

坚强是说给别人听的谎言 提交于 2020-12-06 05:13:47
问题 I’m trying to view a CreateReactApp project from a different device. I tried setting the host to 0.0.0.0 by setting the “start” script to: "start": "cross-env HOST=0.0.0.0 react-scripts start". Though the console did log Attempting to bind to HOST environment variable: 0.0.0.0 If this was unintentional, check that you haven't mistakenly set it in your shell. Learn more here: [URL BLOCKED BY GITHUB]. I could not access this project from another device on the same network using the computer’s

Reference file in public folder from CSS in create-react-app

我只是一个虾纸丫 提交于 2020-12-01 02:36:13
问题 I am using creat-react-app (CRA) and simply want to include a png file placed in the public folder via CSS (I keep all image files there). Now I am trying to reference this image via CSS (I only added the background-image line to a freshly generated CRA app): .App-header { background-color: #222; height: 150px; padding: 20px; color: white; background-image: url("../public/example.png"); } You attempted to import example.png which falls outside of the project src/ directory How do I reference

Reference file in public folder from CSS in create-react-app

十年热恋 提交于 2020-12-01 02:35:51
问题 I am using creat-react-app (CRA) and simply want to include a png file placed in the public folder via CSS (I keep all image files there). Now I am trying to reference this image via CSS (I only added the background-image line to a freshly generated CRA app): .App-header { background-color: #222; height: 150px; padding: 20px; color: white; background-image: url("../public/example.png"); } You attempted to import example.png which falls outside of the project src/ directory How do I reference

Reference file in public folder from CSS in create-react-app

怎甘沉沦 提交于 2020-12-01 02:35:38
问题 I am using creat-react-app (CRA) and simply want to include a png file placed in the public folder via CSS (I keep all image files there). Now I am trying to reference this image via CSS (I only added the background-image line to a freshly generated CRA app): .App-header { background-color: #222; height: 150px; padding: 20px; color: white; background-image: url("../public/example.png"); } You attempted to import example.png which falls outside of the project src/ directory How do I reference