mirror of
https://github.com/discourse/discourse.git
synced 2025-04-08 07:51:40 +08:00
DEV: Stop live-reloading locally on SCSS changes (#16193)
The `testem.scss` include triggers a live reload locally. We need these styles when running `ember test --server`, so this loads that stylesheet only in that scenario.
This commit is contained in:
parent
593f3e5dd8
commit
d19b5fe80b
@ -15,6 +15,8 @@ module.exports = function (defaults) {
|
|||||||
let vendorJs = discourseRoot + "/vendor/assets/javascripts/";
|
let vendorJs = discourseRoot + "/vendor/assets/javascripts/";
|
||||||
|
|
||||||
const isProduction = EmberApp.env().includes("production");
|
const isProduction = EmberApp.env().includes("production");
|
||||||
|
const isTest = EmberApp.env().includes("test");
|
||||||
|
|
||||||
let app = new EmberApp(defaults, {
|
let app = new EmberApp(defaults, {
|
||||||
autoRun: false,
|
autoRun: false,
|
||||||
"ember-qunit": {
|
"ember-qunit": {
|
||||||
@ -91,7 +93,15 @@ module.exports = function (defaults) {
|
|||||||
sourceMapConfig: false,
|
sourceMapConfig: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
return mergeTrees([tests, testHelpers]);
|
if (isTest) {
|
||||||
|
return mergeTrees([
|
||||||
|
tests,
|
||||||
|
testHelpers,
|
||||||
|
discourseScss(`${discourseRoot}/app/assets/stylesheets`, "testem.scss"),
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return mergeTrees([tests, testHelpers]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// WARNING: We should only import scripts here if they are not in NPM.
|
// WARNING: We should only import scripts here if they are not in NPM.
|
||||||
@ -110,7 +120,6 @@ module.exports = function (defaults) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const mergedTree = mergeTrees([
|
const mergedTree = mergeTrees([
|
||||||
discourseScss(`${discourseRoot}/app/assets/stylesheets`, "testem.scss"),
|
|
||||||
createI18nTree(discourseRoot, vendorJs),
|
createI18nTree(discourseRoot, vendorJs),
|
||||||
app.toTree(),
|
app.toTree(),
|
||||||
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user