更改不带命令行标志的 Ember 构建目录(dist 文件夹)



我正在尝试将我的 Ember 项目构建到项目外部的目录中,对于将来的构建,我不想每次都使用命令行标志。ember build --output-path=/not-dist对我有用,但我希望 Ember 自动添加标志。

outputPaths: {
app: {
html: '../presentation/index.cfm',
css: {
'app': '../presentation/assets/ember-presentation-viewer.css'
},
js: '../presentation/assets/ember-presentation-viewer.js'
},
vendor: {
css: '../presentation/assets/vendor.css',
js: '../presentation/assets/vendor.js'
}
}

我已经按照 ember-cli 文档尝试过这个,但ember-presentation-viewer.css坚持在dist目录中构建,并将所有其他路径放在那里。

有没有办法做到这一点?

转到package.json。更改scripts/build命令:

"scripts": {
"build": "ember build --output-path=/not-dist"
},

从现在开始,运行:

npm run build

您可以配置.ember-cli.js文件以指定应始终包含在命令行构建中的标志(小驼峰大小写(,如 Ember 文档中的此页面所示。要更改输出目录,您需要添加以下行:"outputPath": "../../example-folder/presentation".

因此,您的最终.ember-cli.js应如下所示:

{
/*
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,
"outputPath": "../../example-folder/presentation"
}

最新更新