gpt4 book ai didi

ember.js - 嵌套插件 CSS 未合并到 vendor.css

转载 作者:行者123 更新时间:2023-12-02 03:27:55 25 4
gpt4 key购买 nike

我有一个插件,my-addon-parent,它依赖于一个嵌套的插件,my-addon-nested,它通过 dependencies 指定 my-addon-parent 的 package.json 中的属性。

当我为 my-addon-parent 运行虚拟应用程序时,嵌套插件的 CSS 被正确导入(我使用 included 钩子(Hook)来指定导入)并添加到 vendor.css 文件。

但是,当在 Ember 应用程序中包含 my-addon-parent 时,嵌套的插件 CSS 不会添加到 vendor.css 文件中。有没有我缺少的 Hook /设置?下面是应用程序的 package.json 以及父插件和嵌套插件各自的 index.js 文件。

Ember 应用 package.json

{
"name": "my-app",
"version": "0.0.0",
"description": "My App.",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.0",
"connect-restreamer": "^1.0.1",
"ember-cli": "0.2.0",
"ember-cli-app-version": "0.3.2",
"ember-cli-babel": "^4.0.0",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.8",
"ember-cli-htmlbars": "0.7.4",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.3.9",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.15",
"ember-export-application-global": "^1.0.2",
"express": "^4.12.3",
"glob": "^4.5.3",
"morgan": "^1.5.2",
"my-addon-parent": "some/location"
}
}

my-addon-parent index.js

/* jshint node: true */
'use strict';

module.exports = {
name: 'my-addon-parent',

included: function (app) {
this._super.included(app);

app.import('vendor/my-addon-parent/my-addon-parent.css');
}
};

我的插件嵌套 index.js

/* jshint node: true */
'use strict';

module.exports = {
name: 'my-addon-nested',

included: function (app) {
this._super.included(app);

app.import('vendor/my-addon-nested/my-addon-nested.css');
}
};

最佳答案

目前这是不可能的。详情 here .

关于ember.js - 嵌套插件 CSS 未合并到 vendor.css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29311794/

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