From 3f48357e39563778cd5888f4f2cd93159c214660 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sat, 1 Apr 2017 15:12:23 +0300 Subject: [PATCH] chore: module build + export services --- build/webpack.prod.js | 24 ++++++++++++------------ lib/redoc.module.ts | 16 ++++++++++++++-- package.json | 6 ++++-- tsconfig.json | 3 ++- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/build/webpack.prod.js b/build/webpack.prod.js index 1b517d66..e21d6735 100644 --- a/build/webpack.prod.js +++ b/build/webpack.prod.js @@ -49,18 +49,18 @@ const config = webpackMerge(commonConfig({ minimize: true, debug: false }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false, - screw_ie8: true, - negate_iife: false // for lazy v8 - }, - mangle: { screw_ie8 : true }, - output: { - comments: false - }, - sourceMap: true - }), + // new webpack.optimize.UglifyJsPlugin({ + // compress: { + // warnings: false, + // screw_ie8: true, + // negate_iife: false // for lazy v8 + // }, + // mangle: { screw_ie8 : true }, + // output: { + // comments: false + // }, + // sourceMap: true + // }), new webpack.BannerPlugin(BANNER) ] }) diff --git a/lib/redoc.module.ts b/lib/redoc.module.ts index b3081fc0..5e5a5dca 100644 --- a/lib/redoc.module.ts +++ b/lib/redoc.module.ts @@ -17,6 +17,7 @@ import { ComponentParser, ContentProjector, Marker, + SchemaHelper, SearchService, COMPONENT_PARSER_ALLOWED } from './services/'; @@ -39,9 +40,20 @@ import { SpecManager } from './utils/spec-manager'; { provide: ErrorHandler, useClass: CustomErrorHandler }, { provide: COMPONENT_PARSER_ALLOWED, useValue: { 'security-definitions': SecurityDefinitions} } ], - exports: [Redoc] + exports: [Redoc, REDOC_DIRECTIVES, REDOC_COMMON_DIRECTIVES, REDOC_PIPES] }) export class RedocModule { } -export { Redoc, SpecManager }; +export { Redoc, SpecManager, ScrollService, +Hash, +WarningsService, +OptionsService, +AppStateService, +ComponentParser, +ContentProjector, +MenuService, +SearchService, +SchemaHelper, +LazyTasksService, +Marker }; diff --git a/package.json b/package.json index 2ffe2e96..10c974b3 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "node": ">=6.9", "npm": ">=3.0.0" }, - "main": "dist/redoc.min.js", + "main": "dist/redoc-module.js", "scripts": { "test": "npm run lint && node ./build/run_tests.js", "branch-release": "git reset --hard && branch-release", @@ -33,7 +33,9 @@ "webdriver": "webdriver-manager update", "serve:prod": "NODE_ENV=production npm start", "protractor": "protractor", - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1" + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1", + "build:prod-module": "npm run build:sass && npm run ngc && npm run webpack:prod && IS_MODULE=true npm run webpack:prod", + "build:module": "npm run build:sass && npm run ngc && IS_MODULE=true npm run webpack:prod" }, "keywords": [ "OpenAPI", diff --git a/tsconfig.json b/tsconfig.json index 10461ce5..fbb918e7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,10 +13,11 @@ "should", "webpack" ], + "outDir": "dist", "lib": [ "DOM", "ES2016", "DOM.Iterable" ], - "noEmitHelpers": true + "noEmitHelpers": false }, "compileOnSave": false, "exclude": [