Skip to content

Commit 6473e62

Browse files
committed
fix: fix usage with CRA by transpiling swagger2openapi deps
fixes #566
1 parent cbfc226 commit 6473e62

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"shelljs": "^0.8.1",
107107
"source-map-loader": "^0.2.1",
108108
"style-loader": "^0.21.0",
109+
"swagger2openapi": "^3.2.8",
109110
"ts-jest": "^23.0.0",
110111
"ts-loader": "4.4.2",
111112
"ts-node": "^7.0.0",
@@ -147,7 +148,6 @@
147148
"slugify": "^1.2.1",
148149
"stickyfill": "^1.1.1",
149150
"styled-components": "^3.3.3",
150-
"swagger2openapi": "^3.2.8",
151151
"tslib": "^1.9.3"
152152
},
153153
"resolutions": {

webpack.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ import * as path from 'path';
66

77
const nodeExternals = require('webpack-node-externals')({
88
// bundle in moudules that need transpiling + non-js (e.g. css)
9-
whitelist: ['swagger2openapi', /reftools/, /\.(?!(?:jsx?|json)$).{1,5}$/i],
9+
whitelist: [
10+
'swagger2openapi',
11+
/reftools/,
12+
'oas-resolver',
13+
'oas-kit-common',
14+
'oas-schema-walker',
15+
/\.(?!(?:jsx?|json)$).{1,5}$/i,
16+
],
1017
});
1118

1219
const VERSION = JSON.stringify(require('./package.json').version);
@@ -99,7 +106,7 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
99106
exclude: ['node_modules'],
100107
},
101108
{
102-
test: /node_modules\/(swagger2openapi|reftools)\/.*\.js$/,
109+
test: /node_modules\/(swagger2openapi|reftools|oas-resolver|oas-kit-common|oas-schema-walker)\/.*\.js$/,
103110
use: {
104111
loader: 'ts-loader',
105112
options: {

0 commit comments

Comments
 (0)