Skip to content

Commit 6f89f28

Browse files
authored
Webpack build should ignore .d.ts and .map file (#378)
1 parent 6200ff8 commit 6f89f28

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"jest-environment-jsdom": "^29.3.1",
122122
"npm-quick-run": "^1.18.0",
123123
"npm-run-all": "^4.1.5",
124+
"null-loader": "^4.0.1",
124125
"prettier": "^2.8.1",
125126
"prop-types": "^15.7.2",
126127
"sass-loader": "^10.1.1",

webpack.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,18 @@ module.exports = (env, argv) => {
177177
loader: 'url-loader',
178178
options: { limit: 10000, mimetype: 'application/font-woff' }
179179
},
180-
{ test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/i, loader: 'file-loader' }
180+
{
181+
test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
182+
loader: 'file-loader'
183+
},
184+
{
185+
test: /\.(d.ts)$/, /* latest react-sdk-components needs to ignore compiling .d.ts and .map files */
186+
loader: 'null-loader',
187+
},
188+
{
189+
test: /\.(map)$/, /* latest react-sdk-components needs to ignore compiling .d.ts and .map files */
190+
loader: 'null-loader',
191+
}
181192
]
182193
},
183194
/* optimization: { splitChunks: { chunks: "all", minSize: 600000, maxSize: 200000} }, */

0 commit comments

Comments
 (0)