diff --git a/packages/core/stencil.config.ts b/packages/core/stencil.config.ts index 96108244e..16afa3298 100644 --- a/packages/core/stencil.config.ts +++ b/packages/core/stencil.config.ts @@ -12,6 +12,7 @@ import { webOutputTarget } from '@baloise/output-target-web' const IS_BAL_DS_RELEASE = process.env.BAL_DS_RELEASE === 'true' const IS_BAL_DOCUMENTATION = process.env.BAL_DOCUMENTATION === 'true' const IS_BAL_DEVELOPMENT = process.env.BAL_DEVELOPMENT === 'true' +const IS_BAL_TESTING = process.env.BAL_TESTING === 'true' if (IS_BAL_DS_RELEASE) { console.log('') @@ -31,6 +32,12 @@ if (IS_BAL_DEVELOPMENT) { console.log('') } +if (IS_BAL_TESTING) { + console.log('') + console.log('🧪 Build is set to testing 🧪') + console.log('') +} + const workspaceDir = join(parse(__dirname).dir, '..') const packagesDir = join(workspaceDir, 'packages') const nodeModulesProject = join(__dirname, 'node_modules') @@ -38,7 +45,7 @@ const nodeModulesWorkspace = join(workspaceDir, 'node_modules') export const config: Config = { autoprefixCss: true, - sourceMap: false, + sourceMap: IS_BAL_TESTING || IS_BAL_DEVELOPMENT, namespace: 'baloise-design-system', hashedFileNameLength: 10, enableCache: true, @@ -66,14 +73,17 @@ export const config: Config = { ...(!IS_BAL_DEVELOPMENT ? [ CustomDocumentationGenerator, + webOutputTarget({ + dir: IS_BAL_TESTING ? '../../e2e/generated/components' : 'components', + isTest: IS_BAL_TESTING, + }), { type: 'dist-custom-elements', - dir: 'components', + dir: IS_BAL_TESTING ? '../../e2e/generated/components' : 'components', + empty: true, includeGlobalScripts: false, + generateTypeDeclarations: true, }, - webOutputTarget({ - proxiesFile: 'config/custom-elements/all.js', - }), ] : []), { @@ -113,17 +123,12 @@ export const config: Config = { dest: 'assets/fonts', warn: true, }, - // { - // src: join(packagesDir, 'core', '.tmp', 'all.js'), - // dest: '../components/all.js', - // warn: true, - // }, ], }, /** * Skip those outputs for documentation releases on vercel */ - ...(!IS_BAL_DOCUMENTATION + ...(!IS_BAL_DOCUMENTATION && !IS_BAL_TESTING ? [ { type: 'docs-vscode',