Skip to content

Commit

Permalink
chore: fix declarations emit
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed May 17, 2018
1 parent 135651a commit f7bf0b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"strictNullChecks": true,
"sourceMap": true,
"declaration": true,
"declarationDir": "typings",
"noEmitHelpers": true,
"importHelpers": true,
"outDir": "lib",
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declarationDir": "typings"
},
"include": [
"./custom.d.ts",
"src/index.ts"
Expand Down
15 changes: 11 additions & 4 deletions webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as webpack from 'webpack';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
/* tslint:disable:no-implicit-dependencies */
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as webpack from 'webpack';

import * as path from 'path';

const nodeExternals = require('webpack-node-externals')({
Expand Down Expand Up @@ -54,8 +56,12 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
}
: (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');
if (/esprima$/i.test(request)) return callback(null, 'var undefined');
if (/node-fetch$/i.test(request)) {
return callback(null, 'var undefined');
}
if (/esprima$/i.test(request)) {
return callback(null, 'var undefined');
}
return nodeExternals(context, request, callback);
},

Expand All @@ -69,6 +75,7 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
options: {
compilerOptions: {
module: 'es2015',
declaration: false,
},
},
},
Expand Down

0 comments on commit f7bf0b8

Please sign in to comment.