fix: override webpack output config for cra based editors (#1108)

This commit is contained in:
Johnny A
2022-06-15 10:49:38 -04:00
committed by GitHub
parent 83309b3e5c
commit f076057f4b
7 changed files with 36 additions and 5 deletions

View File

@@ -0,0 +1,10 @@
module.exports = function override(config, env) {
config.ignoreWarnings = [/Failed to parse source map/]
config.output = {
...config.output,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
assetModuleFilename: 'static/media/[name].[ext]',
}
return config
}

View File

@@ -0,0 +1,2 @@
const override = require('../../cra-app.override')
module.exports = override

View File

@@ -14,15 +14,15 @@
"homepage": ".",
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "react-scripts start",
"compile": "react-scripts build",
"start": "react-app-rewired start",
"compile": "react-app-rewired build",
"prepublishOnly": "npm run build",
"clean-deploy-cache": "rm -rf node_modules/.cache/gh-pages",
"predeploy": "yarn run pretty && yarn run build && yarn clean-deploy-cache",
"deploy-build": "yarn run predeploy && gh-pages -b build -d build",
"deploy-dev": "yarn run predeploy && gh-pages -b dev -d build",
"deploy-stable": "yarn run predeploy && gh-pages -b gh-pages -d build",
"custom:test": "react-scripts test --watchAll=false",
"custom:test": "react-app-rewired test --watchAll=false",
"test:coverage": "npm run test -- --coverage --watchAll",
"eject": "react-scripts eject",
"serve": "serve -s -p 3000 build",
@@ -116,6 +116,7 @@
"node-sass": "*",
"prettier": "*",
"react": "17.0.2",
"react-app-rewired": "^2.2.1",
"react-beautiful-dnd": "13.1.0",
"react-dom": "17.0.2",
"react-redux": "7.2.8",

View File

@@ -0,0 +1,2 @@
const override = require('../../cra-app.override')
module.exports = override

View File

@@ -14,8 +14,8 @@
"homepage": ".",
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "react-scripts start",
"compile": "react-scripts build",
"start": "react-app-rewired start",
"compile": "react-app-rewired build",
"eject": "react-scripts eject",
"compile:lint": "prettier --write 'src/**/*.{html,css,scss,js,jsx,ts,tsx,json}' README.md"
},
@@ -56,6 +56,7 @@
"material-icons": "^1.10.8",
"prettier": "*",
"react": "^17.0.2",
"react-app-rewired": "^2.2.1",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-scripts": "^5.0.0",