Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit e7f122b

Browse files
committed
build: update build process to only bundle .js and .d.ts files
This PR is meant to stop packaging full TypeScript files in the library. This breaks testing capabilities in Angular, and is overall unnecessary. Instead, we transpile all files using tsc into a separate directory, and only publish that directory, with the root files (index.js and index.d.ts) specified in package.json. There are no breaking changes in this PR, but if you are building from source, please make sure to update your dev dependencies. * add outDir to tsconfig for bundling * upgrade to angular v5 and use new compiler instead of just tsc * clean up package.jsom npm scripts * add exports to index.ts to allow for root import * move inline builder to separate directory * add dev dependencies for TypeScript building * add files and directories to npmignore to allow for root packaging * move protractor config to root level * change webpack to use ts-loader * Fixes #49 BREAKING CHANGE: Due to the change in how folders are exported, all imports from `preboot` must come as a root import, e.g. `import {ServerPrebootModule} from 'preboot';` instead of `import {ServerPrebootModule} from 'preboot/server';`
1 parent 9576ece commit e7f122b

24 files changed

+5171
-81
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ logs
55
.vscode
66
.DS_Store
77
**/.DS_Store
8+
lib
89

910
# Runtime data
1011
pids
@@ -56,3 +57,5 @@ test/coverage
5657
/record.d.ts
5758
/replay.js
5859
/replay.d.ts
60+
61+
*.ngfactory.ts

.npmignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,16 @@
44
.DS_Store
55
*.pid
66
*.seed
7+
8+
# top-level files
9+
CONTRIBUTING.md
10+
package-lock.json
11+
prettier.config.js
12+
protractor.conf.js
13+
tsconfig.json
14+
tslint.json
15+
16+
# top-level directories
17+
build
18+
src
19+
test

browser.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/build/inline.preboot.builder.ts renamed to build/inline.preboot.builder.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'reflect-metadata';
22
import { minify } from 'uglify-js';
3-
import { getEventRecorderCode } from '../server';
3+
import { getEventRecorderCode } from '../src/server';
44
import fs = require('fs');
55
import path = require('path');
66

7-
const distDir = path.join(__dirname, '../../dist');
8-
const filePath = path.join(distDir, 'preboot.js');
9-
const fileMinPath = path.join(distDir, 'preboot.min.js');
7+
const distDir = __dirname;
8+
const filePath = path.join(distDir, '../lib/preboot.js');
9+
const fileMinPath = path.join(distDir, '../lib/preboot.min.js');
1010
const eventRecorderCode = getEventRecorderCode();
1111
const eventRecorderModule = `module.exports = function () {
1212
${eventRecorderCode}

0 commit comments

Comments
 (0)