mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
17 lines
460 B
JavaScript
17 lines
460 B
JavaScript
|
import loaderUrils from 'loader-utils'
|
||
|
|
||
|
module.exports = function (content) {
|
||
|
this.cacheable()
|
||
|
|
||
|
const query = loaderUrils.parseQuery(this.query)
|
||
|
const name = query.name || '[hash].[ext]'
|
||
|
const context = query.context || this.options.context
|
||
|
const regExp = query.regExp
|
||
|
const opts = { context, content, regExp }
|
||
|
const interpolatedName = loaderUrils.interpolateName(this, name, opts)
|
||
|
|
||
|
this.emitFile(interpolatedName, content)
|
||
|
|
||
|
return content
|
||
|
}
|