Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
create-react-app v5
Browse files Browse the repository at this point in the history
最初動かなかったので
@craco/craco をremove (v5に対応してなかった)
これを参考にproxyの設定を変えた facebook/create-react-app#11762
  • Loading branch information
mieze018 committed Feb 20, 2022
1 parent 0a329c1 commit cf4d16e
Show file tree
Hide file tree
Showing 3 changed files with 3,668 additions and 6,468 deletions.
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@craco/craco": "^6.4.1",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
Expand All @@ -23,19 +22,19 @@
"react-lazy-load-image-component": "^1.5.1",
"react-router": "^6.0.2",
"react-router-dom": "^6.2.1",
"react-scripts": "^4.0.3",
"react-scripts": "5.0.0",
"react-transition-group": "^4.4.2",
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
"tslib": "^2.3.1",
"typescript": "^4.5.4",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "craco start",
"start": "react-scripts start",
"test": "react-scripts test",
"eject": "react-scripts eject",
"build": "GENERATE_SOURCEMAP=false craco build",
"deploy": "GENERATE_SOURCEMAP=false craco build && gh-pages -d build",
"test": "craco test",
"eject": "craco eject",
"lint:css": "stylelint --fix **/*.{css,scss,sass}"
},
"eslintConfig": {
Expand Down Expand Up @@ -66,6 +65,5 @@
"stylelint-config-standard": "^24.0.0",
"stylelint-csstree-validator": "^2.0.0",
"stylelint-prettier": "^2.0.0"
},
"proxy": "http://localhost:3000"
}
}
14 changes: 14 additions & 0 deletions src/setupProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,18 @@ module.exports = function (app) {
changeOrigin: true
})
);
app.use(
process.env.REACT_APP_api_URI,
createProxyMiddleware({
target: 'http://localhost:3000/',
changeOrigin: true
})
);
app.use(
process.env.REACT_APP_api_URI,
createProxyMiddleware({
target: 'http://localhost:6000/',
changeOrigin: true
})
);
};
Loading

0 comments on commit cf4d16e

Please sign in to comment.