Skip to content

Commit b19702c

Browse files
author
DoubleU23
committed
🎉 webpack4 compatible
1 parent fd2abda commit b19702c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ module.exports = function(content) {
1414
if (process.env.NODE_ENV === 'production')
1515
this.cacheable && this.cacheable()
1616

17-
if(!this.emitFile)
18-
throw new Error('emitFile is required from module system')
17+
var options = Object.assign(
18+
{},
19+
{transform: true}, // defaultOptions
20+
loaderUtils.getOptions(this) // could be null
21+
)
1922

20-
var query = loaderUtils.parseQuery(this.query)
21-
, transform = typeof query.transform === 'boolean' ? query.transform : true
22-
, url = loaderUtils.interpolateName(this, query.name || '[hash].[ext]', {
23-
context: query.context || this.options.context,
24-
content: content,
25-
regExp: query.regExp
26-
})
27-
, result = nativeCss.convert(content)
28-
, returnVal = transform ? transformToNestedDomStyleObjects(result) : result
23+
// TBD: interpolateName()
24+
// https://github.com/webpack/loader-utils#interpolatename
25+
26+
var result = nativeCss.convert(content)
27+
// TBD: use "humps" for transformation
28+
, returnVal = options.transform ? transformToNestedDomStyleObjects(result) : result
2929

3030
return 'module.exports = ' + JSON.stringify(returnVal)
3131
}

0 commit comments

Comments
 (0)