Skip to content

Commit

Permalink
build: use partial-Ivy format
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Drop support for ViewEngine
  • Loading branch information
kukhariev committed Nov 6, 2021
1 parent ea017db commit 2ae0fd2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ng: [latest, 10]
ng: [latest, 12]
name: Build app with @angular/cli
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"description": "Some script examples",
"scripts": {
"build:latest": "npm run build:ng latest -prefix ../",
"build:ng10": "npm run build:ng 10 -prefix ../",
"build:ng12": "npm run build:ng 12 -prefix ../",
"build:next": "npm run build:ng next -prefix ../",
"test:latest": "npm run test -prefix latest",
"clean": "npx rimraf ./*/",
"serve:latest": "npx angular-http-server --path latest/dist/latest",
"serve:ng10": "npx angular-http-server --path ng10/dist/ng10"
"serve:ng12": "npx angular-http-server --path ng12/dist/ng12"
}
}
13 changes: 9 additions & 4 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//@ts-check
const { promises: fsp } = require('fs');
const { build } = require('ng-packagr');
const packagr = require('ng-packagr');

async function buildPkg() {
try {
const libPackagePath = 'src/uploadx/package.json';
const rootPackage = JSON.parse(await fsp.readFile('package.json', 'utf8'));
const libPackage = {};
libPackage.name = rootPackage.name;
Expand All @@ -22,11 +23,15 @@ async function buildPkg() {
dest: '../../dist/uploadx',
deleteDestPath: true
};
await fsp.writeFile('src/uploadx/package.json', JSON.stringify(libPackage, undefined, 2));
await build({ project: 'src/uploadx/package.json' });
await fsp.writeFile(libPackagePath, JSON.stringify(libPackage));
await packagr
.ngPackagr()
.forProject(libPackagePath)
.withTsConfig('src/uploadx/tsconfig.lib.json')
.build();
await fsp.copyFile('LICENSE', 'dist/uploadx/LICENSE');
await fsp.copyFile('README.md', 'dist/uploadx/README.md');
await fsp.unlink('src/uploadx/package.json');
await fsp.unlink(libPackagePath);
} catch (error) {
console.error(error);
process.exit(1);
Expand Down
25 changes: 25 additions & 0 deletions src/uploadx/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"angularCompilerOptions": {
"compilationMode": "partial",
"strictTemplates": true,
"enableResourceInlining": true
},
"buildOnSave": false,
"compileOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"outDir": "",
"declaration": true,
"inlineSourceMap": true,
"inlineSources": true,
"skipLibCheck": true,
"emitDecoratorMetadata": false,
"experimentalDecorators": true,
"importHelpers": true,
"lib": ["dom", "es2018"]
},
"exclude": ["node_modules", "dist", "**/*.ngfactory.ts", "**/*.shim.ts", "**/*.spec.ts"]
}

0 comments on commit 2ae0fd2

Please sign in to comment.