diff --git a/lib/.npmignore b/lib/.npmignore index bd6c7fe..f0e06b3 100644 --- a/lib/.npmignore +++ b/lib/.npmignore @@ -1,2 +1,2 @@ *.ts -!*.d.ts \ No newline at end of file +!*.d.ts diff --git a/lib/README.md b/lib/README.md index 24bfe77..2eea4e5 100644 --- a/lib/README.md +++ b/lib/README.md @@ -41,7 +41,7 @@ ng update ngx-build-plus --force - ``ng build --single-bundle``: Puts everything reachable from the main entry point into one bundle. Polyfills, scripts, and styles stay in their own bundles as the consuming application might have its own versions of these. -### Schamtics +### Schematics - ``ng add ngx-build-plus`` - ``ng g ngx-build-plus:wc-polyfill``: Adds webcomponent polyfills to your app diff --git a/lib/schematics/add-ngx-build-plus/index.ts b/lib/schematics/add-ngx-build-plus/index.ts index 80a0e7f..75703b0 100644 --- a/lib/schematics/add-ngx-build-plus/index.ts +++ b/lib/schematics/add-ngx-build-plus/index.ts @@ -22,11 +22,10 @@ export function addNgxBuildPlus(_options: any): Rule { serve.builder = 'ngx-build-plus:dev-server'; const test = architect.test; - if (!test) throw new Error(`expected node projects/${project}/architect/test in angular.json`); - test.builder = 'ngx-build-plus:karma'; + if (test) test.builder = 'ngx-build-plus:karma'; return updateWorkspace(workspace); }; } - \ No newline at end of file + diff --git a/lib/schematics/externals/index.ts b/lib/schematics/externals/index.ts index 1dba151..9058b40 100644 --- a/lib/schematics/externals/index.ts +++ b/lib/schematics/externals/index.ts @@ -137,10 +137,10 @@ function updateScripts(path: string, config: any, tree: Tree, _options: any, _co // Heuristic for default project if (!project.root) { - config.scripts['build:externals'] = `ng build --extra-webpack-config ${path}webpack.externals.js --prod ${additionalFlags}`; + config.scripts['build:externals'] = `ng build --extra-webpack-config ${path}/webpack.externals.js --prod ${additionalFlags}`; } if (_options.project) { - config.scripts[`build:${_options.project}:externals`] = `ng build --extra-webpack-config ${path}webpack.externals.js --prod --project ${_options.project} ${additionalFlags}`; + config.scripts[`build:${_options.project}:externals`] = `ng build --extra-webpack-config ${path}/webpack.externals.js --prod --project ${_options.project} ${additionalFlags}`; } -} \ No newline at end of file +} diff --git a/lib/src/browser/index.ts b/lib/src/browser/index.ts index b4daf91..4a42b1a 100644 --- a/lib/src/browser/index.ts +++ b/lib/src/browser/index.ts @@ -11,5 +11,6 @@ export function buildWebpackBrowserPlus( return runBuilderHandler(options, transforms, context, executeBrowserBuilder); } +export { buildWebpackBrowserPlus as executeBrowserBuilderPlus }; //export default createBuilder(buildWebpackBrowserPlus); export default createBuilder(buildWebpackBrowserPlus); \ No newline at end of file diff --git a/readme.md b/readme.md index 24bfe77..21e622c 100644 --- a/readme.md +++ b/readme.md @@ -18,6 +18,7 @@ Big thanks to [Rob Wormald](https://twitter.com/robwormald) and [David Herges](h - Angular 6-7/ CLI 6-7: ngx-build-plus@^7 - Angular 8/ CLI 8: ngx-build-plus^8.0.0 +- Angular 9/ CLI 9: ngx-build-plus^9.0.0 ## Updating to Version 8 @@ -41,7 +42,7 @@ ng update ngx-build-plus --force - ``ng build --single-bundle``: Puts everything reachable from the main entry point into one bundle. Polyfills, scripts, and styles stay in their own bundles as the consuming application might have its own versions of these. -### Schamtics +### Schematics - ``ng add ngx-build-plus`` - ``ng g ngx-build-plus:wc-polyfill``: Adds webcomponent polyfills to your app @@ -81,12 +82,12 @@ Please find the example shown here in the sample application in the folder ``pro declare const VERSION: string; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] }) export class AppComponent { - title = 'Version: ' + VERSION; + title = 'Version: ' + VERSION; } ``` @@ -239,7 +240,7 @@ The result of this description can be found in the [repository's](https://github ng g ngx-build-plus:wc-polyfill --project myProject ``` -5. Execute the externals schematc: +5. Execute the externals schematic: ``` ng g ngx-build-plus:externals --project myProject @@ -262,7 +263,7 @@ The result of this description can be found in the [repository's](https://github 7. Build your application. You can use the npm script created by the above mentioned schematic: ``` - npm run build:externals:myProject + npm run build:myProject:externals ``` 8. Angular will now be compiled into a ``scripts.js`` and can be reused amongs several seperately compiled bundles. Your code is in the main bundle which is quite tiny b/c it does not contain Angular.