gpt4 book ai didi

angular - 在 angular-cli.json 中指定样式顺序

转载 作者:太空狗 更新时间:2023-10-29 18:20:52 25 4
gpt4 key购买 nike

我正在使用第三方库 mydatepickerrange对于 Angular 2。在 angular-cli-.json 中,我像这样加载包:

    "packages": {
...
"mydaterangepicker" :{
"map" : "node_modules/mydaterangepicker",
"defaultExtension": "js"
}

我想在这个包之后加载我的 style.css 以覆盖它的样式。我不确定该怎么做,有没有人遇到过类似的情况?下面是我现在的 angular-cli.json:

{
"project": {
"version": "1.0.0-beta.19-3",
"name": "..."
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [],
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"addons": [],
"packages": {
"moment": {
"map": "node_modules/moment/moment.js",
"type": "cjs",
"defaultExtension": "js"
},
"mydaterangepicker" :{
"map" : "node_modules/mydaterangepicker",
"defaultExtension": "js"
}
},
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
}

最佳答案

我在 CLI v1.0.0-beta.26 上遇到了同样的问题。我将“styles.css”放在文件列表的最后,它起作用了。捆绑时必须有一些潜在的顺序要求......

关于angular - 在 angular-cli.json 中指定样式顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41148081/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com