[plugin-generator] choose between .scss and .css file at startup (#34134)
This commit is contained in:
parent
b5cdb6df6e
commit
93b2fca25d
|
@ -1,3 +1,8 @@
|
|||
<% if (generateScss) { -%>
|
||||
import { resolve } from 'path';
|
||||
import { existsSync } from 'fs';
|
||||
|
||||
<% } -%>
|
||||
<% if (generateApi) { -%>
|
||||
import exampleRoute from './server/routes/example';
|
||||
|
||||
|
@ -20,7 +25,7 @@ export default function (kibana) {
|
|||
],
|
||||
<%_ } -%>
|
||||
<%_ if (generateScss) { -%>
|
||||
styleSheetPaths: require('path').resolve(__dirname, 'public/app.scss'),
|
||||
styleSheetPaths: [resolve(__dirname, 'public/app.scss'), resolve(__dirname, 'public/app.css')].find(p => existsSync(p)),
|
||||
<%_ } -%>
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue