@bcoe/test-alternate-main
Advanced tools
+1
-1
| { | ||
| "name": "@bcoe/test-alternate-main", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "teting a scoped package search (abc123)", | ||
@@ -5,0 +5,0 @@ "main": "foo.min.js", |
+36
-9
@@ -1,17 +0,44 @@ | ||
| THIS IS A WORK IN PROGRESS! | ||
| # test alternate `main` | ||
| @angular/cli does not minify HTML templates before the AOT process leading to extremely bloated script modules. | ||
| Test specifying an alternate `main`: | ||
| NOTE: | ||
| **package.json**: | ||
| This currently does not work as a global package, install it locally to the project. | ||
| ```json | ||
| { | ||
| "name": "@bcoe/test-alternate-main", | ||
| "version": "1.0.1", | ||
| "description": "teting a scoped package search (abc123)", | ||
| "main": "foo.min.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "author": "Ben Coe <ben@npmjs.com>", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| }, | ||
| "repository": { | ||
| "url": "https://github.com/bcoe-test/testing-publishes.git" | ||
| } | ||
| } | ||
| ``` | ||
| BUGS: | ||
| **index.js**: | ||
| Currently since the latest node.js update calling this as a npm script e.g. ngc, no longer works. To call this as a npm script please do the following: | ||
| ```js | ||
| module.exports = {donotload: 'me'} | ||
| ``` | ||
| build: node ./node_modules/ng-compiler/cli/index.js build | ||
| **foo.min.js**: | ||
| build-prod: node ./node_modules/ng-compiler/cli/index.js build --prod | ||
| ```js | ||
| module.exports = {test: 'two'} | ||
| ``` | ||
| serve: node ./node_modules/ng-compiler/cli/index.js serve | ||
| ```bash | ||
| Benjamins-MacBook-Pro:tmp benjamincoe$ npm i @bcoe/test-alternate-main | ||
| @bcoe/test-alternate-main@1.0.1 node_modules/@bcoe/test-alternate-main | ||
| Benjamins-MacBook-Pro:tmp benjamincoe$ node | ||
| > require('@bcoe/test-alternate-main') | ||
| { test: 'two' } | ||
| ``` |
1362
25.99%45
150%