Skip to content

Commit ec4f684

Browse files
LaurentClaesclaude
andcommitted
Fix vanilla-drylus build for Node.js 22 (OpenSSL 3)
Add --openssl-legacy-provider for webpack 4's MD4 hash usage and update extract-emotion externals for react-map-gl migration and ESM compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 22fcca2 commit ec4f684

2 files changed

Lines changed: 25 additions & 8 deletions

File tree

packages/extract-emotion/index.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,28 @@ async function build(input, output) {
1212
output: {
1313
path: output,
1414
},
15-
externals: {
16-
'mapbox-gl': '{}',
17-
'react-mapbox-wrapper': '{}',
18-
'@drawbotics/use-screen-size': '{}',
15+
resolve: {
16+
mainFields: ['main', 'module'],
1917
},
18+
module: {
19+
rules: [
20+
{ test: /\.mjs$/, include: /node_modules/, type: 'javascript/auto' },
21+
],
22+
},
23+
externals: [
24+
{ 'mapbox-gl': '{}' },
25+
{ 'react-map-gl': '{}' },
26+
{ 'framer-motion': '{}' },
27+
{ 'animejs': '{}' },
28+
{ '@drawbotics/use-screen-size': '{}' },
29+
function(context, request, callback) {
30+
// Ignore CSS imports and problematic modules that don't contribute emotion styles
31+
if (/\.css$/.test(request) || /^mapbox-gl/.test(request) || /^get-user-locale/.test(request)) {
32+
return callback(null, '{}');
33+
}
34+
callback();
35+
},
36+
],
2037
});
2138
compiler.outputFileSystem = memFs;
2239

packages/vanilla-drylus/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"scripts": {
1010
"clean": "rimraf dist",
1111
"sync": "node scripts/sync.js",
12-
"watch:lib": "NODE_ENV=development webpack --config webpack.config.js --watch",
12+
"watch:lib": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=development webpack --config webpack.config.js --watch",
1313
"watch:react": "node ./scripts/watch-react.js",
14-
"watch": "NODE_ENV=development webpack --config webpack.config.js --watch",
15-
"build:lib": "NODE_ENV=production webpack --config webpack.config.js",
16-
"extract-css": "extract-emotion ./src/styles/react-components.js --output ./src/styles/ --prefix Drylus --filename react-styles.css",
14+
"watch": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=development webpack --config webpack.config.js --watch",
15+
"build:lib": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --config webpack.config.js",
16+
"extract-css": "NODE_OPTIONS=--openssl-legacy-provider extract-emotion ./src/styles/react-components.js --output ./src/styles/ --prefix Drylus --filename react-styles.css",
1717
"build": "npm run clean && cd ../react-drylus && npm run build && cd ../vanilla-drylus && npm run extract-css && npm run build:lib",
1818
"build:dev": "npm run build && NODE_ENV=development npm run sync",
1919
"prepublishOnly": "npm run build && NODE_ENV=production npm run sync"

0 commit comments

Comments
 (0)