Skip to content

Commit

Permalink
chore: disable source-maps for css loader
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Mar 22, 2018
1 parent 384c883 commit 3fabce4
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -92,7 +90,7 @@ export default (env: { standalone?: boolean } = {}) => ({
use: {
loader: 'css-loader',
options: {
sourceMap: true,
sourceMap: false,
minimize: true,
},
},
Expand All @@ -106,6 +104,6 @@ export default (env: { standalone?: boolean } = {}) => ({
__REDOC_REVISION__: REVISION,
}),
new ForkTsCheckerWebpackPlugin({ silent: true }),
new webpack.BannerPlugin(BANNER)
new webpack.BannerPlugin(BANNER),
],
});

0 comments on commit 3fabce4

Please sign in to comment.