Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
22fd0cc7
Unverified
Commit
22fd0cc7
authored
Sep 15, 2023
by
Zach Pomerantz
Committed by
GitHub
Sep 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: fix sourcemap warnings (#7318)
parent
784fbfe7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
craco.config.cjs
craco.config.cjs
+6
-7
package.json
package.json
+1
-1
No files found.
craco.config.cjs
View file @
22fd0cc7
...
@@ -131,6 +131,12 @@ module.exports = {
...
@@ -131,6 +131,12 @@ module.exports = {
},
},
})
})
// Retain source maps for node_modules packages:
webpackConfig.module.rules[0] = {
...webpackConfig.module.rules[0],
exclude: /node_modules/,
}
// Configure webpack transpilation (create-react-app specifies transpilation rules in a oneOf):
// Configure webpack transpilation (create-react-app specifies transpilation rules in a oneOf):
webpackConfig.module.rules[1].oneOf = webpackConfig.module.rules[1].oneOf.map((rule) => {
webpackConfig.module.rules[1].oneOf = webpackConfig.module.rules[1].oneOf.map((rule) => {
if (rule.loader && rule.loader.match(/babel-loader/)) {
if (rule.loader && rule.loader.match(/babel-loader/)) {
...
@@ -170,13 +176,6 @@ module.exports = {
...
@@ -170,13 +176,6 @@ module.exports = {
// Configure webpack resolution. webpackConfig.cache is unused with swc-loader, but the resolver can still cache:
// Configure webpack resolution. webpackConfig.cache is unused with swc-loader, but the resolver can still cache:
webpackConfig.resolve = Object.assign(webpackConfig.resolve, { unsafeCache: true })
webpackConfig.resolve = Object.assign(webpackConfig.resolve, { unsafeCache: true })
webpackConfig.ignoreWarnings = [
// Source mappings for a package will fail if the package does not provide them, but the build will still succeed,
// so it is unnecessary (and bothersome) to log it. This should be turned off when debugging missing sourcemaps.
// See https://webpack.js.org/loaders/source-map-loader#ignoring-warnings.
/Failed to parse source map/,
]
return webpackConfig
return webpackConfig
},
},
},
},
...
...
package.json
View file @
22fd0cc7
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
"start"
:
"craco start"
,
"start"
:
"craco start"
,
"start:cloud"
:
"NODE_OPTIONS=--dns-result-order=ipv4first PORT=3001 npx wrangler pages dev --compatibility-flags=nodejs_compat --compatibility-date=2023-08-01 --proxy=3001 --port=3000 -- yarn start"
,
"start:cloud"
:
"NODE_OPTIONS=--dns-result-order=ipv4first PORT=3001 npx wrangler pages dev --compatibility-flags=nodejs_compat --compatibility-date=2023-08-01 --proxy=3001 --port=3000 -- yarn start"
,
"build"
:
"craco build"
,
"build"
:
"craco build"
,
"analyze"
:
"source-map-explorer 'build/static/js/*.js' --
only-mapped
"
,
"analyze"
:
"source-map-explorer 'build/static/js/*.js' --
no-border-checks --gzip
"
,
"serve"
:
"serve build -s -l 3000"
,
"serve"
:
"serve build -s -l 3000"
,
"lint"
:
"yarn eslint --ignore-path .gitignore --cache --cache-location node_modules/.cache/eslint/ ."
,
"lint"
:
"yarn eslint --ignore-path .gitignore --cache --cache-location node_modules/.cache/eslint/ ."
,
"typecheck"
:
"tsc"
,
"typecheck"
:
"tsc"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment