Update CommonJS detection to work inside Component