A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| const MODULE_DIR = /(.*([\/\\]node_modules|\.\.)[\/\\](@[^\/\\]+[\/\\])?[^\/\\]+)([\/\\].*)?$/g; | |
| { | |
| loader: 'babel-loader', | |
| test: /\.jsx?$/, | |
| include(filepath) { | |
| if (filepath.split(/[/\\]/).indexOf('node_modules')===-1) return true; | |
| let pkg, manifest = path.resolve(filepath.replace(MODULE_DIR, '$1'), 'package.json'); | |
| try { pkg = JSON.parse(fs.readFileSync(manifest)); } catch (e) {} | |
| return !!(pkg.module || pkg['jsnext:main']); |