Ghost/ghost/core/test/utils/admin-utils.js
Kevin Ansfield 0a34be4012
Updated admin asset serving for ember-auto-import@2 compatibility (#15128)
refs https://github.com/TryGhost/Admin/pull/2252
closes https://github.com/TryGhost/Team/issues/1182

- Admin now copies it's build output to a single env-specific directory rather than splitting html and assets
  - `core/built/admin/{development|production}/*`
- updated the admin app's `serveStatic` definition for assets and controller's html serving to reflect the new asset paths
2022-08-02 13:43:45 +01:00

18 lines
515 B
JavaScript

const fs = require('fs-extra');
const path = require('path');
const adminFiles = [
'built/admin/development/index.html',
'built/admin/development/assets/ghost.js',
'built/admin/development/assets/ghost.css',
'built/admin/development/assets/vendor.js',
'built/admin/development/assets/vendor.css'
];
module.exports.stubAdminFiles = () => {
adminFiles.forEach((file) => {
const filePath = path.resolve(__dirname, '../../core/', file);
fs.ensureFileSync(filePath);
});
};