From 6473e6269c405d29184ea52b5280dae6906acc72 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Thu, 19 Jul 2018 20:23:46 +0300 Subject: [PATCH] fix: fix usage with CRA by transpiling swagger2openapi deps fixes #566 --- package.json | 2 +- webpack.config.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 18441cb1..c3e527ce 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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": { diff --git a/webpack.config.ts b/webpack.config.ts index 08d6f3c5..03dc1f5d 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -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); @@ -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: {