| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository presents a workaround for angular/angular-cli#2688.
This project was generated with Angular CLI version 7.3.7.
Source: https://alligator.io/angular/custom-webpack-config/
Run npm run build:prod to build the project. The build artifacts will be stored in the dist/ directory. This will output the following stucture:
|_ dist
|_ index.html
|_ favicon.ico
|_ app/
|_ main.js
|_ styles.js
|_ ...
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run npm run serve:prod for checking production build locally. Navigate to http://localhost:4200/.
"customWebpackConfig": {
"path": "./extra-webpack.config.js",
"replaceDuplicatePlugins": true
}`
"deployUrl": "app/", "baseHref": "",
const fs = require('fs');
module.exports = (config, options) => {
config.plugins.push({
apply: (compiler) => {
compiler.hooks.afterEmit.tap('MyAfterEmitPlugin', (compilation) => {
// Replace 'app' path below with your subfolder path
fs.renameSync('./dist/app/index.html', './dist/index.html');
fs.renameSync('./dist/app/favicon.ico', './dist/favicon.ico');
});
}
});
return config;
};
This workaround works with deployments using context-path like http://hostname:xxxx/myapp
| Back | FazBrowse Home | New Git URL |