ember-cli-deploy / ember-cli-deploy/ember-cli-deploy-json-config

Respect outputPaths in ember-cli-build

Offen
#34 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
17
Forks
11
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I recently implemented this addon and noticed that the index.json output does not respect the `outputPaths` config setting in `ember-cli-build.js`. Here is a sample of my configuration and the resulting index.json output from `ember deploy production`:

```
// ember-cli-build.js
const isProduction = ( process.env.EMBER_ENV || 'development' ) === 'production';
const assetPath = isProduction ? '' : '/assets';

module.exports = function(defaults) {
var app = new EmberApp(defaults, {
outputPaths: {
app: {
html: 'index.html',
css: {
'app': assetPath + '/app.css'
},
js: assetPath + '/app.js'
},
vendor: {
css: assetPath + '/vendor.css',
js: assetPath + '/vendor.js'
}
}
});
}
```

```
// config/deploy.js
var ENV = {
build: {},
'json-config': {
jsonBlueprint(context, pluginHelper) {
var jsonBlueprint = pluginHelper.readConfigDefault('jsonBlueprint');
jsonBlueprint.script.includeContent = true;
return jsonBlueprint;
}
}
};
```

```
// index.json
{
"base": [],
"meta": [],
"link": [{
"rel": "stylesheet",
"href": "assets/vendor-13455b8fd285c046141dd54ae73890f8.css"
}, {
"rel": "stylesheet",
"href": "assets/app-efe517a8fe179e4392e64c2a9ce8fe05.css"
}],
"script": [{
"src": "assets/vendor-127d2a9b59896b5ddff4de18193179cb.js"
}, {
"src": "assets/app-774827c1c48acfbdb034cbc16d3f5fb7.js"
}]
}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit dem Plugin-Code, der index.json erstellt, und vergleiche dessen generierte Asset-Pfade mit der in ember-cli-build.js gezeigten outputPaths-Konfiguration. Verwende config/deploy.js und die Beispiel-index.json als Referenzen und führe anschließend ember deploy production aus, um zu überprüfen, dass die generierten Link- und Script-Pfade die konfigurierte outputPaths-Konfiguration berücksichtigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
build-system
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.