-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add publicPath support via command and angular-cli.json (#…
…3285) Add publicPath option for webpack. User can specify publicPath via `--deploy-url` / `-d` from command line or add `deployUrl` to `angular-cli.json`. It can solve following issues: Change the public URL address of the output files (different from baseUrl). Manipulate the request url for chunk js files. It is very helpful to solve resources url and route lazying load issues for those applications which have different static files paths such as ASP.NET MVC. Fixes #3136 Fixes #2960 Fixes #2276 Fixes #2241 Fixes #3344
- Loading branch information
1 parent
e271adc
commit 0ce64a4
Showing
8 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {ng} from '../../utils/process'; | ||
import {expectFileToMatch} from '../../utils/fs'; | ||
import {updateJsonFile} from '../../utils/project'; | ||
|
||
|
||
export default function() { | ||
return ng('build', '-d', 'deployUrl/') | ||
.then(() => expectFileToMatch('dist/index.html', 'deployUrl/main.bundle.js')) | ||
.then(() => updateJsonFile('angular-cli.json', configJson => { | ||
const app = configJson['apps'][0]; | ||
app['deployUrl'] = 'config-deployUrl/'; | ||
})) | ||
.then(() => ng('build')) | ||
.then(() => expectFileToMatch('dist/index.html', 'config-deployUrl/main.bundle.js')); | ||
} |
0ce64a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an issue for this commit. Hopefully I am just using it wrong.
#5478