kenken999 commited on
Commit
e43cee9
·
1 Parent(s): 450d2b3

fix: add webpack config override to resolve punycode polyfill for Strapi admin panel build

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. src/admin/webpack.config.js +11 -0
Dockerfile CHANGED
@@ -20,10 +20,11 @@ RUN node -e " \
20
  "
21
 
22
  RUN npm install --legacy-peer-deps
23
- RUN npm install --save pg@8.11.3
24
 
25
  COPY config/database.js ./config/database.js
26
  COPY config/server.js ./config/server.js
 
27
  COPY docker-entrypoint.sh /docker-entrypoint.sh
28
  RUN chmod +x /docker-entrypoint.sh
29
 
 
20
  "
21
 
22
  RUN npm install --legacy-peer-deps
23
+ RUN npm install --save pg@8.11.3 punycode
24
 
25
  COPY config/database.js ./config/database.js
26
  COPY config/server.js ./config/server.js
27
+ COPY src/admin/webpack.config.js ./src/admin/webpack.config.js
28
  COPY docker-entrypoint.sh /docker-entrypoint.sh
29
  RUN chmod +x /docker-entrypoint.sh
30
 
src/admin/webpack.config.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ // Fix: webpack5 does not include Node.js core polyfills by default
4
+ // markdown-it requires 'punycode' which is a deprecated Node.js built-in
5
+ module.exports = (config) => {
6
+ config.resolve.fallback = {
7
+ ...(config.resolve.fallback || {}),
8
+ punycode: require.resolve('punycode/'),
9
+ };
10
+ return config;
11
+ };