Skip to content

Commit d201b37

Browse files
feat: add template support, teardown & standalone (#23117)
Co-authored-by: Jordan <jordan@jpdesigning.com> Co-authored-by: Zachary Williams <zachjw34@gmail.com> Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
1 parent cdc12b9 commit d201b37

File tree

11 files changed

+395
-73
lines changed

11 files changed

+395
-73
lines changed

npm/angular/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "dist/index.js",
66
"scripts": {
77
"prebuild": "rimraf dist",
8-
"build": "tsc || echo 'built, with type errors'",
8+
"build": "rollup -c rollup.config.js",
99
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
1010
"build-prod": "yarn build",
1111
"check-ts": "tsc --noEmit"
@@ -15,6 +15,8 @@
1515
"@angular/common": "^14.0.6",
1616
"@angular/core": "^14.0.6",
1717
"@angular/platform-browser-dynamic": "^14.0.6",
18+
"@rollup/plugin-node-resolve": "^11.1.1",
19+
"rollup-plugin-typescript2": "^0.29.0",
1820
"typescript": "~4.2.3",
1921
"zone.js": "~0.11.4"
2022
},

npm/angular/rollup.config.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import ts from 'rollup-plugin-typescript2'
2+
import resolve from '@rollup/plugin-node-resolve'
3+
4+
import pkg from './package.json'
5+
6+
const banner = `
7+
/**
8+
* ${pkg.name} v${pkg.version}
9+
* (c) ${new Date().getFullYear()} Cypress.io
10+
* Released under the MIT License
11+
*/
12+
`
13+
14+
function createEntry () {
15+
const input = 'src/index.ts'
16+
const format = 'es'
17+
18+
const config = {
19+
input,
20+
external: [
21+
'@angular/core',
22+
'@angular/core/testing',
23+
'@angular/common',
24+
'@angular/platform-browser-dynamic/testing',
25+
'zone.js',
26+
'zone.js/testing',
27+
],
28+
plugins: [
29+
resolve(),
30+
],
31+
output: {
32+
banner,
33+
name: 'CypressAngular',
34+
file: pkg.module,
35+
format,
36+
exports: 'auto',
37+
},
38+
}
39+
40+
console.log(`Building ${format}: ${config.output.file}`)
41+
42+
config.plugins.push(
43+
ts({
44+
check: true,
45+
tsconfigOverride: {
46+
compilerOptions: {
47+
declaration: true,
48+
target: 'es6', // not sure what this should be?
49+
module: 'esnext',
50+
},
51+
exclude: [],
52+
},
53+
}),
54+
)
55+
56+
return config
57+
}
58+
59+
export default [
60+
createEntry(),
61+
]

0 commit comments

Comments
 (0)