Angular 自定义网页包配置不支持';t散列图像
我正在使用angular@8.0.2和角形建筑/定制-webpack@8.4.1. 我试图在建房的时候破坏我的资产,但什么也没发生 这是我的webpack.config.js文件:Angular 自定义网页包配置不支持';t散列图像,angular,svg,webpack,build,assets,Angular,Svg,Webpack,Build,Assets,我正在使用angular@8.0.2和角形建筑/定制-webpack@8.4.1. 我试图在建房的时候破坏我的资产,但什么也没发生 这是我的webpack.config.js文件: module.exports = { module : { rules: [ { test: /\.(png|jpg|gif|svg)$/, loader: 'file-loader', options: { name:'[n
module.exports = {
module : {
rules: [
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name:'[name].[hash].[ext]',
outputPath:'images/',
}
}
]
}
};
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./webpack.config.js"
},
"outputPath": "dist/",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico"
],
这是我的angular.json文件的相关部分:
module.exports = {
module : {
rules: [
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name:'[name].[hash].[ext]',
outputPath:'images/',
}
}
]
}
};
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./webpack.config.js"
},
"outputPath": "dist/",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico"
],
我的项目结构:
│ angular.json
│ package.json
│ webpack.config.js
│
└───src
│ favicon.ico
│ index.html
│ main.ts
│ polyfills.ts
│ styles.scss
│ test.ts
│
├───app
│ │ app-routing.module.ts
│ │ app.component.html
│ │ app.component.scss
│ │ app.component.ts
│ │ app.module.ts
│ │
│ └───module
│ │ module.module.ts
│ │
│ └───components
│ ├───images
│ │ a.svg
│ │ b.svg
│ │ c.svg
│ │ d.svg
│ │
│ ├───component1
│ │ component1.component.html
│ │ component1.component.scss
│ │ component1.component.ts
│ │
│ ├───component2
│ │ component2.component.html
│ │ component2.component.scss
│ │ component2.component.spec.ts
│ │ component2.component.ts
当我运行ng build--prod时,我得到的是:
3rdpartylicenses.txt
favicon.ico
index.html
main-es2015.eb1987c86fa74ed8cb58.js
main-es5.eb1987c86fa74ed8cb58.js
polyfills-es2015.d74c0c190b9196b834d3.js
polyfills-es5.bf12ddb50191f9d58a90.js
runtime-es2015.2770a5446ad989574354.js
runtime-es5.2770a5446ad989574354.js
styles.069f02bc2114af319bd8.css
正如你所看到的,没有一个SVG在那里
我做错了什么