forked from Redocly/redoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: modernize build pipeline (Redocly#1635)
- Loading branch information
1 parent
92387bc
commit c09cf9d
Showing
21 changed files
with
9,232 additions
and
14,357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import * as webpack from 'webpack'; | ||
|
||
export function getBabelLoader({useBuiltIns, hot}: {useBuiltIns: boolean, hot?: boolean}) { | ||
return { | ||
loader: 'babel-loader', | ||
options: { | ||
babelrc: false, | ||
sourceType: 'unambiguous', | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
useBuiltIns: useBuiltIns ? 'usage' : false, | ||
corejs: 3, | ||
exclude: ['transform-typeof-symbol'], | ||
targets: 'defaults', | ||
modules: false, | ||
}, | ||
], | ||
['@babel/preset-react', { development: false, runtime: 'classic' }], | ||
'@babel/preset-typescript', | ||
], | ||
plugins: [ | ||
['@babel/plugin-proposal-decorators', { legacy: true }], | ||
['@babel/plugin-proposal-class-properties', { loose: false }], | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
corejs: false, | ||
helpers: true, | ||
// eslint-disable-next-line import/no-internal-modules | ||
version: require('@babel/runtime/package.json').version, | ||
regenerator: true, | ||
}, | ||
], | ||
'@babel/plugin-proposal-optional-chaining', | ||
'@babel/plugin-proposal-nullish-coalescing-operator', | ||
hot ? 'react-hot-loader/babel' : undefined, | ||
].filter(Boolean) | ||
}, | ||
}; | ||
} | ||
|
||
export function webpackIgnore(regexp) { | ||
return new webpack.NormalModuleReplacementPlugin(regexp, require.resolve('lodash/noop.js')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as React from 'react'; | ||
// eslint-disable-next-line import/no-internal-modules | ||
import { hot } from 'react-hot-loader/root'; | ||
import { RedocStandalone as RedocStandaloneOrig, RedocStandaloneProps } from '../../src'; | ||
|
||
const RedocStandalone = function (props: RedocStandaloneProps) { | ||
return <RedocStandaloneOrig {...props} />; | ||
} | ||
|
||
export default hot(RedocStandalone); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.