parent
2a47cdf0aa
commit
f95f855cf7
@ -48,6 +48,14 @@ Type: `string`
|
|||||||
|
|
||||||
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
|
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
|
||||||
|
|
||||||
|
### deleteOutputPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Delete the output path before building.
|
||||||
|
|
||||||
### deployUrl
|
### deployUrl
|
||||||
|
|
||||||
Type: `string`
|
Type: `string`
|
||||||
|
|||||||
@ -28,6 +28,14 @@ Possible values: `dependencies`, `peerDependencies`
|
|||||||
|
|
||||||
When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`
|
When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`
|
||||||
|
|
||||||
|
### deleteOutputPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Delete the output path before building.
|
||||||
|
|
||||||
### entryFile
|
### entryFile
|
||||||
|
|
||||||
Type: `string`
|
Type: `string`
|
||||||
|
|||||||
@ -49,6 +49,14 @@ Type: `string`
|
|||||||
|
|
||||||
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
|
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
|
||||||
|
|
||||||
|
### deleteOutputPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Delete the output path before building.
|
||||||
|
|
||||||
### deployUrl
|
### deployUrl
|
||||||
|
|
||||||
Type: `string`
|
Type: `string`
|
||||||
|
|||||||
@ -29,6 +29,14 @@ Possible values: `dependencies`, `peerDependencies`
|
|||||||
|
|
||||||
When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`
|
When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`
|
||||||
|
|
||||||
|
### deleteOutputPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Delete the output path before building.
|
||||||
|
|
||||||
### entryFile
|
### entryFile
|
||||||
|
|
||||||
Type: `string`
|
Type: `string`
|
||||||
|
|||||||
@ -49,6 +49,14 @@ Type: `string`
|
|||||||
|
|
||||||
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
|
The crossorigin attribute to use for generated javascript script tags. One of 'none' | 'anonymous' | 'use-credentials'
|
||||||
|
|
||||||
|
### deleteOutputPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Delete the output path before building.
|
||||||
|
|
||||||
### deployUrl
|
### deployUrl
|
||||||
|
|
||||||
Type: `string`
|
Type: `string`
|
||||||
|
|||||||
@ -29,6 +29,14 @@ Possible values: `dependencies`, `peerDependencies`
|
|||||||
|
|
||||||
When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`
|
When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`
|
||||||
|
|
||||||
|
### deleteOutputPath
|
||||||
|
|
||||||
|
Default: `true`
|
||||||
|
|
||||||
|
Type: `boolean`
|
||||||
|
|
||||||
|
Delete the output path before building.
|
||||||
|
|
||||||
### entryFile
|
### entryFile
|
||||||
|
|
||||||
Type: `string`
|
Type: `string`
|
||||||
|
|||||||
@ -74,6 +74,15 @@ describe('Web Components Applications', () => {
|
|||||||
`dist/libs/${libName}/_should_remove.txt`
|
`dist/libs/${libName}/_should_remove.txt`
|
||||||
);
|
);
|
||||||
checkFilesExist(`dist/apps/_should_not_remove.txt`);
|
checkFilesExist(`dist/apps/_should_not_remove.txt`);
|
||||||
|
|
||||||
|
// `delete-output-path`
|
||||||
|
createFile(`dist/apps/${appName}/_should_keep.txt`);
|
||||||
|
runCLI(`build ${appName} --delete-output-path=false`);
|
||||||
|
checkFilesExist(`dist/apps/${appName}/_should_keep.txt`);
|
||||||
|
|
||||||
|
createFile(`dist/libs/${libName}/_should_keep.txt`);
|
||||||
|
runCLI(`build ${libName} --delete-output-path=false`);
|
||||||
|
checkFilesExist(`dist/libs/${libName}/_should_keep.txt`);
|
||||||
}, 120000);
|
}, 120000);
|
||||||
|
|
||||||
it('should do another build if differential loading is needed', async () => {
|
it('should do another build if differential loading is needed', async () => {
|
||||||
|
|||||||
@ -56,6 +56,8 @@ export interface WebBuildBuilderOptions extends BuildBuilderOptions {
|
|||||||
|
|
||||||
verbose?: boolean;
|
verbose?: boolean;
|
||||||
buildLibsFromSource?: boolean;
|
buildLibsFromSource?: boolean;
|
||||||
|
|
||||||
|
deleteOutputPath?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default createBuilder<WebBuildBuilderOptions & JsonObject>(run);
|
export default createBuilder<WebBuildBuilderOptions & JsonObject>(run);
|
||||||
@ -98,7 +100,9 @@ export function run(options: WebBuildBuilderOptions, context: BuilderContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete output path before bundling
|
// Delete output path before bundling
|
||||||
deleteOutputDir(context.workspaceRoot, options.outputPath);
|
if (options.deleteOutputPath) {
|
||||||
|
deleteOutputDir(context.workspaceRoot, options.outputPath);
|
||||||
|
}
|
||||||
|
|
||||||
return from(getSourceRoot(context))
|
return from(getSourceRoot(context))
|
||||||
.pipe(
|
.pipe(
|
||||||
|
|||||||
@ -19,6 +19,11 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The output path of the generated files."
|
"description": "The output path of the generated files."
|
||||||
},
|
},
|
||||||
|
"deleteOutputPath": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Delete the output path before building.",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"watch": {
|
"watch": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Enable re-building when files change.",
|
"description": "Enable re-building when files change.",
|
||||||
|
|||||||
@ -124,7 +124,9 @@ export function run(
|
|||||||
context.logger.info(`Bundling ${context.target.project}...`);
|
context.logger.info(`Bundling ${context.target.project}...`);
|
||||||
|
|
||||||
// Delete output path before bundling
|
// Delete output path before bundling
|
||||||
deleteOutputDir(context.workspaceRoot, options.outputPath);
|
if (options.deleteOutputPath) {
|
||||||
|
deleteOutputDir(context.workspaceRoot, options.outputPath);
|
||||||
|
}
|
||||||
|
|
||||||
return from(rollupOptions).pipe(
|
return from(rollupOptions).pipe(
|
||||||
concatMap((opts) =>
|
concatMap((opts) =>
|
||||||
|
|||||||
@ -15,6 +15,11 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The output path of the generated files."
|
"description": "The output path of the generated files."
|
||||||
},
|
},
|
||||||
|
"deleteOutputPath": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Delete the output path before building.",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"tsConfig": {
|
"tsConfig": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The path to tsconfig file."
|
"description": "The path to tsconfig file."
|
||||||
|
|||||||
@ -60,6 +60,7 @@ export interface PackageBuilderOptions {
|
|||||||
updateBuildableProjectDepsInPackageJson?: boolean;
|
updateBuildableProjectDepsInPackageJson?: boolean;
|
||||||
buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
|
buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
|
||||||
umdName?: string;
|
umdName?: string;
|
||||||
|
deleteOutputPath?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AssetGlobPattern extends JsonObject {
|
export interface AssetGlobPattern extends JsonObject {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user