chore: disable source-maps for css loader

This commit is contained in:
Roman Hotsiy 2018-03-22 18:51:16 +02:00
parent 384c883bb8
commit 3fabce4d19
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -16,13 +16,11 @@ const REVISION = JSON.stringify(
.trim(),
);
const BANNER =
`ReDoc - OpenAPI/Swagger-generated API Reference Documentation
const BANNER = `ReDoc - OpenAPI/Swagger-generated API Reference Documentation
-------------------------------------------------------------
Version: ${VERSION}
Repo: https://github.com/Rebilly/ReDoc`;
export default (env: { standalone?: boolean } = {}) => ({
entry: env.standalone ? ['./src/polyfills.ts', './src/standalone.tsx'] : './src/index.ts',
output: {
@ -51,14 +49,14 @@ export default (env: { standalone?: boolean } = {}) => ({
externals: env.standalone
? {
esprima: 'esprima',
'node-fetch': 'null',
}
esprima: 'esprima',
'node-fetch': 'null',
}
: (context, request, callback) => {
// ignore node-fetch dep of swagger2openapi as it is not used
if (/node-fetch$/i.test(request)) return callback(null, 'var undefined');
return nodeExternals(context, request, callback);
},
// ignore node-fetch dep of swagger2openapi as it is not used
if (/node-fetch$/i.test(request)) return callback(null, 'var undefined');
return nodeExternals(context, request, callback);
},
module: {
rules: [
@ -92,7 +90,7 @@ export default (env: { standalone?: boolean } = {}) => ({
use: {
loader: 'css-loader',
options: {
sourceMap: true,
sourceMap: false,
minimize: true,
},
},
@ -106,6 +104,6 @@ export default (env: { standalone?: boolean } = {}) => ({
__REDOC_REVISION__: REVISION,
}),
new ForkTsCheckerWebpackPlugin({ silent: true }),
new webpack.BannerPlugin(BANNER)
new webpack.BannerPlugin(BANNER),
],
});