Skip to content

Commit

Permalink
Merge branch 'develop' into feature/issue-5141-version-in-CYPRESS_DOW…
Browse files Browse the repository at this point in the history
…NLOAD_PATH_TEMPLATE
  • Loading branch information
Blue F authored Aug 8, 2022
2 parents 99da8d3 + d201b37 commit 6358a85
Show file tree
Hide file tree
Showing 11 changed files with 395 additions and 73 deletions.
4 changes: 3 additions & 1 deletion npm/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/index.js",
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc || echo 'built, with type errors'",
"build": "rollup -c rollup.config.js",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"build-prod": "yarn build",
"check-ts": "tsc --noEmit"
Expand All @@ -15,6 +15,8 @@
"@angular/common": "^14.0.6",
"@angular/core": "^14.0.6",
"@angular/platform-browser-dynamic": "^14.0.6",
"@rollup/plugin-node-resolve": "^11.1.1",
"rollup-plugin-typescript2": "^0.29.0",
"typescript": "~4.2.3",
"zone.js": "~0.11.4"
},
Expand Down
61 changes: 61 additions & 0 deletions npm/angular/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import ts from 'rollup-plugin-typescript2'
import resolve from '@rollup/plugin-node-resolve'

import pkg from './package.json'

const banner = `
/**
* ${pkg.name} v${pkg.version}
* (c) ${new Date().getFullYear()} Cypress.io
* Released under the MIT License
*/
`

function createEntry () {
const input = 'src/index.ts'
const format = 'es'

const config = {
input,
external: [
'@angular/core',
'@angular/core/testing',
'@angular/common',
'@angular/platform-browser-dynamic/testing',
'zone.js',
'zone.js/testing',
],
plugins: [
resolve(),
],
output: {
banner,
name: 'CypressAngular',
file: pkg.module,
format,
exports: 'auto',
},
}

console.log(`Building ${format}: ${config.output.file}`)

config.plugins.push(
ts({
check: true,
tsconfigOverride: {
compilerOptions: {
declaration: true,
target: 'es6', // not sure what this should be?
module: 'esnext',
},
exclude: [],
},
}),
)

return config
}

export default [
createEntry(),
]
Loading

0 comments on commit 6358a85

Please sign in to comment.