Skip to content

Commit

Permalink
fix: fix usage with CRA by transpiling swagger2openapi deps
Browse files Browse the repository at this point in the history
fixes #566
  • Loading branch information
RomanHotsiy committed Jul 19, 2018
1 parent cbfc226 commit 6473e62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"shelljs": "^0.8.1",
"source-map-loader": "^0.2.1",
"style-loader": "^0.21.0",
"swagger2openapi": "^3.2.8",
"ts-jest": "^23.0.0",
"ts-loader": "4.4.2",
"ts-node": "^7.0.0",
Expand Down Expand Up @@ -147,7 +148,6 @@
"slugify": "^1.2.1",
"stickyfill": "^1.1.1",
"styled-components": "^3.3.3",
"swagger2openapi": "^3.2.8",
"tslib": "^1.9.3"
},
"resolutions": {
Expand Down
11 changes: 9 additions & 2 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import * as path from 'path';

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

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

0 comments on commit 6473e62

Please sign in to comment.