Skip to content

Commit

Permalink
fix(custom-elements): fix copy tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed May 29, 2020
1 parent 39c0a99 commit d810649
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 322 deletions.
20 changes: 16 additions & 4 deletions src/compiler/config/outputs/validate-custom-element-bundle.ts
@@ -1,10 +1,11 @@
import * as d from '../../../declarations';
import { COPY, isOutputTargetDistCustomElementsBundle } from '../../output-targets/output-utils';
import { getAbsolutePath } from '../config-utils';
import { isBoolean } from '@utils';
import { isOutputTargetDistCustomElementsBundle } from '../../output-targets/output-utils';
import { validateCopy } from '../validate-copy';

export const validateCustomElementBundle = (config: d.Config, userOutputs: d.OutputTarget[]) => {
return userOutputs.filter(isOutputTargetDistCustomElementsBundle).map(o => {
return userOutputs.filter(isOutputTargetDistCustomElementsBundle).reduce((arr, o) => {
const outputTarget = {
...o,
dir: getAbsolutePath(config, o.dir || 'dist/custom-elements'),
Expand All @@ -15,6 +16,17 @@ export const validateCustomElementBundle = (config: d.Config, userOutputs: d.Out
if (!isBoolean(outputTarget.externalRuntime)) {
outputTarget.externalRuntime = true;
}
return outputTarget;
});
outputTarget.copy = validateCopy(outputTarget.copy, config.copy);

if (outputTarget.copy.length > 0) {
arr.push({
type: COPY,
dir: config.rootDir,
copy: [...outputTarget.copy],
});
}
arr.push(outputTarget)

return arr;
}, [] as (d.OutputTargetDistCustomElementsBundle | d.OutputTargetCopy)[]);
};
81 changes: 0 additions & 81 deletions src/compiler/copy/assets-copy-tasks.ts

This file was deleted.

198 changes: 0 additions & 198 deletions src/compiler/copy/copy-tasks-worker.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/compiler/copy/hashed-copy.ts

This file was deleted.

24 changes: 0 additions & 24 deletions src/compiler/copy/local-copy-tasks.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/compiler/html/inline-esm-import.ts
@@ -1,6 +1,6 @@
import * as d from '../../declarations';
import { getAbsoluteBuildDir } from './html-utils';
import { generateHashedCopy } from '../copy/hashed-copy';
import { generateHashedCopy } from '../output-targets/copy/hashed-copy';
import { injectModulePreloads } from './inject-module-preloads';
import { isString } from '@utils';
import { join } from 'path';
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/output-targets/output-www.ts
Expand Up @@ -3,7 +3,7 @@ import { addScriptDataAttribute } from '../html/add-script-attr';
import { catchError, flatOne, unique } from '@utils';
import { cloneDocument, serializeNodeToHtml } from '@stencil/core/mock-doc';
import { generateEs5DisabledMessage } from '../app-core/app-es5-disabled';
import { generateHashedCopy } from '../copy/hashed-copy';
import { generateHashedCopy } from '../output-targets/copy/hashed-copy';
import { getAbsoluteBuildDir } from '../html/html-utils';
import { getScopeId } from '../style/scope-css';
import { getUsedComponents } from '../html/used-components';
Expand Down

0 comments on commit d810649

Please sign in to comment.