Skip to content

Commit

Permalink
Handle print.less import
Browse files Browse the repository at this point in the history
  • Loading branch information
jdlrobson committed Sep 21, 2024
1 parent 7824519 commit 637133d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pages/Add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ const DEFAULT_SKIN_PROPS = {
mustache: DEFAULT_SKIN_MUSTACHE
};
/**
* Clears all import statements from the string.
* I couldn't work out how to setup print.less locally...
*
* @param {string} str
* @return {string}
*/
const clearImports = (str) => {

Check failure on line 140 in src/pages/Add.vue

View workflow job for this annotation

GitHub Actions / build (14.17.5)

There must be a space after this paren

Check failure on line 140 in src/pages/Add.vue

View workflow job for this annotation

GitHub Actions / build (14.17.5)

There must be a space before this paren
return str.replace(/@import ["'][^"']*["'];/g, '' );

Check failure on line 141 in src/pages/Add.vue

View workflow job for this annotation

GitHub Actions / build (14.17.5)

There must be a space after this paren
}

Check failure on line 142 in src/pages/Add.vue

View workflow job for this annotation

GitHub Actions / build (14.17.5)

Missing semicolon
function getCached() {
const props = {};
Object.keys( ( DEFAULT_SKIN_PROPS ) ).forEach( ( key ) => {
Expand Down Expand Up @@ -287,7 +297,7 @@ export default {
const lessVars = tokens + '\n' + getLessVarsCode( this.variables );
less.render(
`${lessVars}${this.less}${imports}`,
`${lessVars}${clearImports(this.less)}${imports}`,

Check failure on line 300 in src/pages/Add.vue

View workflow job for this annotation

GitHub Actions / build (14.17.5)

There must be a space after this paren

Check failure on line 300 in src/pages/Add.vue

View workflow job for this annotation

GitHub Actions / build (14.17.5)

There must be a space before this paren
LESS_RENDER_OPTIONS
).then( ( compiledLess ) => {
css = compiledLess.css;
Expand Down

0 comments on commit 637133d

Please sign in to comment.