when I updated to version 8, the custom loader could not execute
See original GitHub issueIn version 7, it can execute docs-loader.js and print docs loader is called!, but when I updated to version 8, the custom loader could not execute.
package.json:
"devDependencies": {
"@angular-builders/custom-webpack": "^8.1.0",
"@angular-devkit/build-angular": "^0.801.0",
"@angular-devkit/build-ng-packagr": "^0.801.0",
"@angular/cli": "^8.1.0"
}
angular.json:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "",
"projects": {
"demo": {
"root": "",
"sourceRoot": "demo/src",
"projectType": "application",
"prefix": "demo",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "extra-webpack.config.js"
},
"indexTransform": "index-html-transform.js",
"outputPath": "docs",
"index": "demo/src/index.html",
"main": "demo/src/main.ts",
"polyfills": "demo/src/polyfills.ts",
"tsConfig": "demo/tsconfig-app.json",
"assets": [],
"styles": [
"node_modules/bootstrap-less/bootstrap/index.less",
"node_modules/prismjs/themes/prism.css",
"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css",
"demo/src/styles.less"
],
"scripts": [
"node_modules/focus-visible/dist/focus-visible.min.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "demo/src/environments/environment.ts",
"with": "demo/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"browserTarget": "demo:build"
},
"configurations": {
"production": {
"browserTarget": "demo:build:production"
}
}
}
}
}
},
"defaultProject": "demo"
}
extra-webpack.config.js:
const helper = require('./tools/helper');
module.exports = {
module: {
rules: [
{
test: /\.(htm|html)$/,
loader: helper.root('tools/docs/docs-loader.js'),
include: [helper.root('demo/src')]
}
]
}
};
docs-loader.js (simplified version):
module.exports = function (source) {
console.log('docs loader is called!');
return source;
};
Issue Analytics
- State:
- Created 4 years ago
- Comments:24 (13 by maintainers)
Top Results From Across the Web
Error: PostCSS plugin autoprefixer requires ... - Stack Overflow
PostCSS was updated to version 8, however, PostCSS CLI has not yet been updated to handle PostCSS plugins which use the new PostCSS...
Read more >Known Issues for JDK 8 - Oracle
This document describes known issues in the Oracle JDK 8 release.
Read more >sass-loader - npm
The sass-loader uses Sass's custom importer feature to pass all queries to the Webpack resolving engine. Thus you can import your Sass modules ......
Read more >Known issues with Android Studio and Android Gradle Plugin
To fix this issue, upgrade your Android 11 emulator to version 9 or higher by navigating to Tools > SDK Manager. In the...
Read more >Windows Installer Error Messages (for Developers)
A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action [2] script ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created two minimal replication repos, corresponding to version 7 and version 8: https://github.com/laixiangran/angular-builders-demo/tree/7.0.0 https://github.com/laixiangran/angular-builders-demo/tree/8.0.0
For the record, I leave here the Typescript that worked out for Angular 12 😄