fix(web): remove default value of baseHref (#6994)

close #5079
This commit is contained in:
Xie Jay 2021-10-05 02:50:26 +08:00 committed by GitHub
parent 9c2a8b155c
commit 2bcc552fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 5 additions and 8 deletions

View File

@ -32,8 +32,6 @@ List of static application assets.
### baseHref ### baseHref
Default: `/`
Type: `string` Type: `string`
Base url for the application being built. Base url for the application being built.

View File

@ -32,8 +32,6 @@ List of static application assets.
### baseHref ### baseHref
Default: `/`
Type: `string` Type: `string`
Base url for the application being built. Base url for the application being built.

View File

@ -32,8 +32,6 @@ List of static application assets.
### baseHref ### baseHref
Default: `/`
Type: `string` Type: `string`
Base url for the application being built. Base url for the application being built.

View File

@ -253,6 +253,7 @@ Object {
assets: ['apps/my-app/src/favicon.ico', 'apps/my-app/src/assets'], assets: ['apps/my-app/src/favicon.ico', 'apps/my-app/src/assets'],
index: 'apps/my-app/src/index.html', index: 'apps/my-app/src/index.html',
main: 'apps/my-app/src/main.tsx', main: 'apps/my-app/src/main.tsx',
baseHref: '/',
outputPath: 'dist/apps/my-app', outputPath: 'dist/apps/my-app',
polyfills: 'apps/my-app/src/polyfills.ts', polyfills: 'apps/my-app/src/polyfills.ts',
scripts: [], scripts: [],

View File

@ -46,6 +46,7 @@ function createBuildTarget(options: NormalizedSchema): TargetConfiguration {
options: { options: {
outputPath: joinPathFragments('dist', options.appProjectRoot), outputPath: joinPathFragments('dist', options.appProjectRoot),
index: joinPathFragments(options.appProjectRoot, 'src/index.html'), index: joinPathFragments(options.appProjectRoot, 'src/index.html'),
baseHref: '/',
main: joinPathFragments( main: joinPathFragments(
options.appProjectRoot, options.appProjectRoot,
maybeJs(options, `src/main.tsx`) maybeJs(options, `src/main.tsx`)

View File

@ -32,8 +32,7 @@
}, },
"baseHref": { "baseHref": {
"type": "string", "type": "string",
"description": "Base url for the application being built.", "description": "Base url for the application being built."
"default": "/"
}, },
"deployUrl": { "deployUrl": {
"type": "string", "type": "string",

View File

@ -258,6 +258,7 @@ describe('app', () => {
expect(architectConfig.build.options).toEqual({ expect(architectConfig.build.options).toEqual({
assets: ['apps/my-app/src/favicon.ico', 'apps/my-app/src/assets'], assets: ['apps/my-app/src/favicon.ico', 'apps/my-app/src/assets'],
index: 'apps/my-app/src/index.html', index: 'apps/my-app/src/index.html',
baseHref: '/',
main: 'apps/my-app/src/main.ts', main: 'apps/my-app/src/main.ts',
outputPath: 'dist/apps/my-app', outputPath: 'dist/apps/my-app',
polyfills: 'apps/my-app/src/polyfills.ts', polyfills: 'apps/my-app/src/polyfills.ts',

View File

@ -54,6 +54,7 @@ function addBuildTarget(
const buildOptions: WebBuildBuilderOptions = { const buildOptions: WebBuildBuilderOptions = {
outputPath: joinPathFragments('dist', options.appProjectRoot), outputPath: joinPathFragments('dist', options.appProjectRoot),
index: joinPathFragments(options.appProjectRoot, 'src/index.html'), index: joinPathFragments(options.appProjectRoot, 'src/index.html'),
baseHref: '/',
main: joinPathFragments(options.appProjectRoot, 'src/main.ts'), main: joinPathFragments(options.appProjectRoot, 'src/main.ts'),
polyfills: joinPathFragments(options.appProjectRoot, 'src/polyfills.ts'), polyfills: joinPathFragments(options.appProjectRoot, 'src/polyfills.ts'),
tsConfig: joinPathFragments(options.appProjectRoot, 'tsconfig.app.json'), tsConfig: joinPathFragments(options.appProjectRoot, 'tsconfig.app.json'),