chore: module build + export services

This commit is contained in:
Roman Hotsiy 2017-04-01 15:12:23 +03:00
parent 303b49e918
commit 3f48357e39
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
4 changed files with 32 additions and 17 deletions

View File

@ -49,18 +49,18 @@ const config = webpackMerge(commonConfig({
minimize: true, minimize: true,
debug: false debug: false
}), }),
new webpack.optimize.UglifyJsPlugin({ // new webpack.optimize.UglifyJsPlugin({
compress: { // compress: {
warnings: false, // warnings: false,
screw_ie8: true, // screw_ie8: true,
negate_iife: false // for lazy v8 // negate_iife: false // for lazy v8
}, // },
mangle: { screw_ie8 : true }, // mangle: { screw_ie8 : true },
output: { // output: {
comments: false // comments: false
}, // },
sourceMap: true // sourceMap: true
}), // }),
new webpack.BannerPlugin(BANNER) new webpack.BannerPlugin(BANNER)
] ]
}) })

View File

@ -17,6 +17,7 @@ import {
ComponentParser, ComponentParser,
ContentProjector, ContentProjector,
Marker, Marker,
SchemaHelper,
SearchService, SearchService,
COMPONENT_PARSER_ALLOWED } from './services/'; COMPONENT_PARSER_ALLOWED } from './services/';
@ -39,9 +40,20 @@ import { SpecManager } from './utils/spec-manager';
{ provide: ErrorHandler, useClass: CustomErrorHandler }, { provide: ErrorHandler, useClass: CustomErrorHandler },
{ provide: COMPONENT_PARSER_ALLOWED, useValue: { 'security-definitions': SecurityDefinitions} } { provide: COMPONENT_PARSER_ALLOWED, useValue: { 'security-definitions': SecurityDefinitions} }
], ],
exports: [Redoc] exports: [Redoc, REDOC_DIRECTIVES, REDOC_COMMON_DIRECTIVES, REDOC_PIPES]
}) })
export class RedocModule { export class RedocModule {
} }
export { Redoc, SpecManager }; export { Redoc, SpecManager, ScrollService,
Hash,
WarningsService,
OptionsService,
AppStateService,
ComponentParser,
ContentProjector,
MenuService,
SearchService,
SchemaHelper,
LazyTasksService,
Marker };

View File

@ -10,7 +10,7 @@
"node": ">=6.9", "node": ">=6.9",
"npm": ">=3.0.0" "npm": ">=3.0.0"
}, },
"main": "dist/redoc.min.js", "main": "dist/redoc-module.js",
"scripts": { "scripts": {
"test": "npm run lint && node ./build/run_tests.js", "test": "npm run lint && node ./build/run_tests.js",
"branch-release": "git reset --hard && branch-release", "branch-release": "git reset --hard && branch-release",
@ -33,7 +33,9 @@
"webdriver": "webdriver-manager update", "webdriver": "webdriver-manager update",
"serve:prod": "NODE_ENV=production npm start", "serve:prod": "NODE_ENV=production npm start",
"protractor": "protractor", "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": [ "keywords": [
"OpenAPI", "OpenAPI",

View File

@ -13,10 +13,11 @@
"should", "should",
"webpack" "webpack"
], ],
"outDir": "dist",
"lib": [ "lib": [
"DOM", "ES2016", "DOM.Iterable" "DOM", "ES2016", "DOM.Iterable"
], ],
"noEmitHelpers": true "noEmitHelpers": false
}, },
"compileOnSave": false, "compileOnSave": false,
"exclude": [ "exclude": [