Skip to content

Commit 3684b50

Browse files
committed
Revert "build: vite"
This reverts commit f8d1470.
1 parent f8d1470 commit 3684b50

File tree

16 files changed

+19762
-6930
lines changed

16 files changed

+19762
-6930
lines changed

craco.config.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
module.exports = {
2+
devServer: {
3+
proxy: {
4+
'/api/show-my-ip': {
5+
target: 'https://api.ipify.org',
6+
changeOrigin: true,
7+
pathRewrite: { '^/api/show-my-ip': '' },
8+
},
9+
},
10+
setupMiddlewares: (middlewares, devServer) => {
11+
if (!devServer) {
12+
throw new Error('webpack-dev-server is not defined');
13+
}
14+
15+
devServer.app.use((req, res, next) => {
16+
if (req.path.endsWith('.piml')) {
17+
res.set('Content-Type', 'text/plain');
18+
}
19+
next();
20+
});
21+
22+
return middlewares;
23+
},
24+
},
25+
webpack: {
26+
configure: (webpackConfig, { env, paths }) => {
27+
// Disable sourcemaps for production
28+
if (env === 'production') {
29+
webpackConfig.devtool = false;
30+
}
31+
32+
// Add a rule to ignore source map warnings from node_modules
33+
webpackConfig.module.rules.push({
34+
test: /\.js$/,
35+
enforce: 'pre',
36+
use: ['source-map-loader'],
37+
exclude: /node_modules/,
38+
});
39+
// Temporarily ignore all source map warnings
40+
webpackConfig.ignoreWarnings = [/Failed to parse source map/];
41+
42+
return webpackConfig;
43+
},
44+
},
45+
};

0 commit comments

Comments
 (0)