fmt/doc/bootstrap/scss/tests/sass-true/register.js

15 lines
377 B
JavaScript
Raw Normal View History

2024-05-27 02:59:42 +00:00
'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)
}