Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
fix(webpack-config): fix sourcemap bug with expo camera (#4735)
Browse files Browse the repository at this point in the history
* fix sourcemap bug with expo camera

* Update webpack.config.ts

* Update webpack.config-test.js.snap
  • Loading branch information
EvanBacon authored Jul 12, 2023
1 parent 9250eef commit 71c32d4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ Object {
"fullySpecified": false,
},
"test": /\\\\\\.\\(js\\|mjs\\|jsx\\|ts\\|tsx\\|css\\)\\$/,
"use": "node_modules/source-map-loader/dist/cjs.js",
"use": Array [
Object {
"loader": "node_modules/source-map-loader/dist/cjs.js",
"options": Object {
"filterSourceMappingUrl": [Function],
},
},
],
},
Object {
"oneOf": Array [
Expand Down Expand Up @@ -270,7 +277,14 @@ Object {
"fullySpecified": false,
},
"test": /\\\\\\.\\(js\\|mjs\\|jsx\\|ts\\|tsx\\|css\\)\\$/,
"use": "node_modules/source-map-loader/dist/cjs.js",
"use": Array [
Object {
"loader": "node_modules/source-map-loader/dist/cjs.js",
"options": Object {
"filterSourceMappingUrl": [Function],
},
},
],
},
Object {
"oneOf": Array [
Expand Down
16 changes: 15 additions & 1 deletion packages/webpack-config/src/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,21 @@ export default async function (env: Environment, argv: Arguments = {}): Promise<
enforce: 'pre',
exclude: /@babel(?:\/|\\{1,2})runtime/,
test: /\.(js|mjs|jsx|ts|tsx|css)$/,
use: require.resolve('source-map-loader'),
use: [
{
loader: require.resolve('source-map-loader'),
options: {
filterSourceMappingUrl(url: string, resourcePath: string) {
// https://github.com/alewin/useWorker/issues/138
if (resourcePath.match(/@koale\/useworker/)) {
return 'remove';
}
return true;
},
},
},
],

resolve: {
fullySpecified: false,
},
Expand Down

0 comments on commit 71c32d4

Please sign in to comment.