Skip to content

Commit

Permalink
feat(copy): remove deprecated copy config
Browse files Browse the repository at this point in the history
Copy configs on each output target should be used instead.
  • Loading branch information
adamdbradley committed Aug 4, 2020
1 parent 9d258e0 commit 6cf3134
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/compiler/config/outputs/validate-custom-element-bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const validateCustomElementBundle = (config: d.Config, userOutputs: d.Out
if (!isBoolean(outputTarget.externalRuntime)) {
outputTarget.externalRuntime = true;
}
outputTarget.copy = validateCopy(outputTarget.copy, config.copy);
outputTarget.copy = validateCopy(outputTarget.copy, []);

if (outputTarget.copy.length > 0) {
arr.push({
Expand All @@ -25,7 +25,7 @@ export const validateCustomElementBundle = (config: d.Config, userOutputs: d.Out
copy: [...outputTarget.copy],
});
}
arr.push(outputTarget)
arr.push(outputTarget);

return arr;
}, [] as (d.OutputTargetDistCustomElementsBundle | d.OutputTargetCopy)[]);
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/config/outputs/validate-dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const validateOutputTargetDist = (config: d.Config, o: d.OutputTargetDist) => {
outputTarget.empty = true;
}

outputTarget.copy = validateCopy(outputTarget.copy, config.copy);
outputTarget.copy = validateCopy(outputTarget.copy, []);
return outputTarget;
};

Expand Down
5 changes: 4 additions & 1 deletion src/compiler/config/outputs/validate-www.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export const validateWww = (config: d.Config, diagnostics: d.Diagnostic[], userO
outputs.push({
type: COPY,
dir: outputTarget.appDir,
copy: validateCopy(outputTarget.copy, [...(config.copy || []), { src: 'assets', warn: false }, { src: 'manifest.json', warn: false }]),
copy: validateCopy(outputTarget.copy, [
{ src: 'assets', warn: false },
{ src: 'manifest.json', warn: false },
]),
});

// Generate global style with original name
Expand Down
3 changes: 0 additions & 3 deletions src/compiler/config/validate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ export const validateConfig = (userConfig?: Config) => {
config.bundles = [];
}

// Default copy
config.copy = config.copy || [];

// validate how many workers we can use
validateWorkers(config);

Expand Down
15 changes: 0 additions & 15 deletions src/declarations/stencil-public-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ export interface StencilConfig {
*/
bundles?: ConfigBundle[];

/**
* The copy config is an array of objects that defines any files or folders that should
* be copied over to the build directory.
*
* Each object in the array must include a src property which can be either an absolute path,
* a relative path or a glob pattern. The config can also provide an optional dest property
* which can be either an absolute path or a path relative to the build directory.
* Also note that any files within src/assets are automatically copied to www/assets for convenience.
*
* In the copy config below, it will copy the entire directory from src/docs-content over to www/docs-content.
*
* @deprecated
*/
copy?: CopyTask[];

/**
* Stencil will cache build results in order to speed up rebuilds.
* To disable this feature, set enableCache to false.
Expand Down

0 comments on commit 6cf3134

Please sign in to comment.