You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
449 B
19 lines
449 B
const path = require('path')
|
|
const {
|
|
resolveUTSCompiler
|
|
} = require('./uts')
|
|
module.exports = function (content) {
|
|
const callback = this.async()
|
|
resolveUTSCompiler().compile(path.dirname(this.resourcePath)).then(result => {
|
|
if (result) {
|
|
result.deps.forEach((dep) => {
|
|
this.addDependency(dep)
|
|
})
|
|
callback(null, result.code)
|
|
} else {
|
|
callback(null, '')
|
|
}
|
|
}).catch(err => {
|
|
callback(err)
|
|
})
|
|
}
|
|
|