veilid-dot-com/themes/veilid/assets/scss/bootstrap/tests/sass-true/register.js
2023-08-15 15:25:21 -04:00

15 lines
377 B
JavaScript

'use strict'
const path = require('node:path')
const runnerPath = path.join(__dirname, 'runner').replace(/\\/g, '/')
require.extensions['.scss'] = (module, filename) => {
const normalizedFilename = filename.replace(/\\/g, '/')
return module._compile(`
const runner = require('${runnerPath}')
runner('${normalizedFilename}', { describe, it })
`, filename)
}