mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-10 19:06:34 +03:00
fix webpack config ts issues
This commit is contained in:
parent
08034dc05f
commit
f7374caf3c
|
@ -12,7 +12,6 @@ env:
|
|||
addons:
|
||||
chrome: stable
|
||||
cache: yarn
|
||||
before_install: if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
|
||||
before_script: npm run bundle
|
||||
deploy:
|
||||
- provider: npm
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
"e2e:clean": "rimraf e2e/.build",
|
||||
"cy:open": "cypress open",
|
||||
"bundle:clean": "rimraf bundles",
|
||||
"bundle:standalone": "webpack -p --env.lib --env.standalone --env.prod ",
|
||||
"bundle:lib": "webpack -p --env.lib --env.prod ",
|
||||
"bundle:standalone": "webpack -p --env.lib --env.standalone --env.prod",
|
||||
"bundle:lib": "webpack -p --env.lib --env.prod",
|
||||
"bundle": "npm run bundle:clean && npm run bundle:lib && npm run bundle:standalone",
|
||||
"stats": "webpack -p --env.prod --json --profile > stats.json",
|
||||
"prettier": "prettier --write \"src/**/*.{ts,tsx}\""
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"target": "es5",
|
||||
"noImplicitAny": false,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import webpack from 'webpack';
|
||||
import * as webpack from 'webpack';
|
||||
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||
import * as nodeExternals from 'webpack-node-externals';
|
||||
|
||||
|
@ -54,7 +54,15 @@ export default env => {
|
|||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
loaders: ['react-hot-loader/webpack', 'awesome-typescript-loader'],
|
||||
use: [
|
||||
'react-hot-loader/webpack',
|
||||
{
|
||||
loader: 'awesome-typescript-loader',
|
||||
options: {
|
||||
module: 'es2015',
|
||||
},
|
||||
},
|
||||
],
|
||||
exclude: ['node_modules'],
|
||||
},
|
||||
{
|
||||
|
@ -89,7 +97,7 @@ export default env => {
|
|||
};
|
||||
|
||||
if (env.prod) {
|
||||
config.plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
|
||||
config.plugins!.push(new webpack.optimize.ModuleConcatenationPlugin());
|
||||
}
|
||||
|
||||
if (env.lib) {
|
||||
|
@ -98,10 +106,10 @@ export default env => {
|
|||
whitelist: ['swagger2openapi', 'reftools', /\.(?!(?:jsx?|json)$).{1,5}$/i],
|
||||
});
|
||||
|
||||
config.output.library = 'Redoc';
|
||||
config.output.libraryTarget = 'umd';
|
||||
config.output!.library = 'Redoc';
|
||||
config.output!.libraryTarget = 'umd';
|
||||
} else {
|
||||
config.plugins.push(
|
||||
config.plugins!.push(
|
||||
new HtmlWebpackPlugin({
|
||||
template: './demo/playground/index.html',
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue
Block a user