[plugin-generator] choose between .scss and .css file at startup (#34134)

This commit is contained in:
Spencer 2019-04-01 12:04:15 -07:00 committed by GitHub
parent b5cdb6df6e
commit 93b2fca25d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)),
<%_ } -%>
},