mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
chore: rolled back webpack.config(s) to previous version
This commit is contained in:
parent
3789c506c8
commit
c015bfd977
|
@ -2,14 +2,18 @@ import * as CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||||
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||||
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
|
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||||
import { compact } from 'lodash';
|
import { compact } from 'lodash';
|
||||||
|
import { resolve } from 'path';
|
||||||
import * as webpack from 'webpack';
|
import * as webpack from 'webpack';
|
||||||
import { root } from '../webpack.config';
|
|
||||||
|
|
||||||
const VERSION = JSON.stringify(require('../package.json').version);
|
const VERSION = JSON.stringify(require('../package.json').version);
|
||||||
const REVISION = JSON.stringify(
|
const REVISION = JSON.stringify(
|
||||||
require('child_process').execSync('git rev-parse --short HEAD').toString().trim(),
|
require('child_process').execSync('git rev-parse --short HEAD').toString().trim(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function root(filename) {
|
||||||
|
return resolve(__dirname + '/' + filename);
|
||||||
|
}
|
||||||
|
|
||||||
const tsLoader = (env) => ({
|
const tsLoader = (env) => ({
|
||||||
loader: 'ts-loader',
|
loader: 'ts-loader',
|
||||||
options: {
|
options: {
|
||||||
|
@ -44,18 +48,18 @@ const babelHotLoader = {
|
||||||
|
|
||||||
export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) => ({
|
export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) => ({
|
||||||
entry: [
|
entry: [
|
||||||
root('src/polyfills.ts'),
|
root('../src/polyfills.ts'),
|
||||||
root(
|
root(
|
||||||
env.playground
|
env.playground
|
||||||
? 'demo/playground/hmr-playground.tsx'
|
? 'playground/hmr-playground.tsx'
|
||||||
: env.bench
|
: env.bench
|
||||||
? 'benchmark/index.tsx'
|
? '../benchmark/index.tsx'
|
||||||
: 'demo/index.tsx',
|
: 'index.tsx',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
filename: 'redoc-demo.bundle.js',
|
filename: 'redoc-demo.bundle.js',
|
||||||
path: root('demo/dist'),
|
path: root('dist'),
|
||||||
globalObject: 'this',
|
globalObject: 'this',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -69,12 +73,20 @@ export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) =
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.tsx', '.js', '.json'],
|
extensions: ['.ts', '.tsx', '.js', '.json'],
|
||||||
alias: {
|
alias:
|
||||||
fs: root('fs.mock.js'),
|
mode !== 'production'
|
||||||
...(mode !== 'production' && { 'react-dom': '@hot-loader/react-dom' })
|
? {
|
||||||
}
|
'react-dom': '@hot-loader/react-dom',
|
||||||
|
}
|
||||||
|
: {},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
node: {
|
||||||
|
fs: 'empty',
|
||||||
|
},
|
||||||
|
|
||||||
performance: false,
|
performance: false,
|
||||||
|
|
||||||
externals: {
|
externals: {
|
||||||
esprima: 'esprima',
|
esprima: 'esprima',
|
||||||
'node-fetch': 'null',
|
'node-fetch': 'null',
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
promises: {
|
|
||||||
readFile () {}
|
|
||||||
},
|
|
||||||
existsSync () {},
|
|
||||||
}
|
|
9234
package-lock.json
generated
9234
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -2,7 +2,6 @@
|
||||||
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||||
import * as webpack from 'webpack';
|
import * as webpack from 'webpack';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { resolve } from 'path';
|
|
||||||
|
|
||||||
const nodeExternals = require('webpack-node-externals')({
|
const nodeExternals = require('webpack-node-externals')({
|
||||||
// bundle in modules that need transpiling + non-js (e.g. css)
|
// bundle in modules that need transpiling + non-js (e.g. css)
|
||||||
|
@ -32,11 +31,6 @@ const BANNER = `ReDoc - OpenAPI/Swagger-generated API Reference Documentation
|
||||||
Version: ${VERSION}
|
Version: ${VERSION}
|
||||||
Repo: https://github.com/Redocly/redoc`;
|
Repo: https://github.com/Redocly/redoc`;
|
||||||
|
|
||||||
|
|
||||||
export function root(filename) {
|
|
||||||
return resolve(__dirname + '/' + filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default (env: { standalone?: boolean } = {}, { mode }) => ({
|
export default (env: { standalone?: boolean } = {}, { mode }) => ({
|
||||||
entry: env.standalone ? ['./src/polyfills.ts', './src/standalone.tsx'] : './src/index.ts',
|
entry: env.standalone ? ['./src/polyfills.ts', './src/standalone.tsx'] : './src/index.ts',
|
||||||
output: {
|
output: {
|
||||||
|
@ -49,15 +43,14 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.tsx', '.js', '.json'],
|
extensions: ['.ts', '.tsx', '.js', '.json'],
|
||||||
alias: {
|
},
|
||||||
fs: root('fs.mock.js')
|
node: {
|
||||||
}
|
fs: 'empty',
|
||||||
},
|
},
|
||||||
performance: false,
|
performance: false,
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: !!env.standalone,
|
minimize: !!env.standalone,
|
||||||
},
|
},
|
||||||
|
|
||||||
externals: env.standalone
|
externals: env.standalone
|
||||||
? {
|
? {
|
||||||
esprima: 'esprima',
|
esprima: 'esprima',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user