From f465f4f20085119205390272ca58554f54735262 Mon Sep 17 00:00:00 2001 From: Giuseppe Gurgone Date: Sat, 12 May 2018 10:35:47 +0200 Subject: [PATCH] Log a message when loading a plugin --- src/_utils.js | 6 ++++++ src/stylesheet-registry.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/_utils.js b/src/_utils.js index 703bc82b..ce26d907 100644 --- a/src/_utils.js +++ b/src/_utils.js @@ -485,6 +485,8 @@ export const combinePlugins = plugins => { } } + log('Loading plugin from path: ' + plugin) + // eslint-disable-next-line import/no-dynamic-require let p = require(plugin) if (p.default) { @@ -638,3 +640,7 @@ export const setStateOptions = state => { }) } } + +export function log(message) { + console.log('[styled-jsx] ' + message) +} diff --git a/src/stylesheet-registry.js b/src/stylesheet-registry.js index 170966fe..781d3891 100644 --- a/src/stylesheet-registry.js +++ b/src/stylesheet-registry.js @@ -1,7 +1,7 @@ import hashString from 'string-hash' import DefaultStyleSheet from './lib/stylesheet' -const sanitize = rule => rule.replace(/\/style/ig, '\\/style') +const sanitize = rule => rule.replace(/\/style/gi, '\\/style') export default class StyleSheetRegistry { constructor({ styleSheet = null,