【发布时间】:2018-12-04 08:28:18
【问题描述】:
在构建 Angular 时,我们需要将 scss 文件部署到 dist 目录。我完全知道在构建之后应该只部署 css,但是我们有自定义需要在运行时读取 scss 文件并执行某些操作。
我尝试在 angular.json 文件中添加以下行(脚本下的最后一行:),但这没有帮助。我在调试过程中找不到任何部署的文件。
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/scss/styles.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.js",
"src/scss/_custom-variables.scss"
]
},
【问题讨论】: