@sucrase/webpack-loader
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -5,5 +5,7 @@ "use strict"; | ||
function loader(code) { | ||
const webpackRemainingChain = loader_utils_1.getRemainingRequest(this).split("!"); | ||
const filePath = webpackRemainingChain[webpackRemainingChain.length - 1]; | ||
const options = loader_utils_1.getOptions(this); | ||
return sucrase_1.transform(code, options); | ||
return sucrase_1.transform(code, Object.assign({ filePath }, options)); | ||
} | ||
module.exports = loader; |
{ | ||
"name": "@sucrase/webpack-loader", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Webpack loader for Sucrase", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,9 +0,11 @@ | ||
import {getOptions} from "loader-utils"; | ||
import {getOptions, getRemainingRequest} from "loader-utils"; | ||
import {Options, transform} from "sucrase"; | ||
function loader(code: string): string { | ||
const webpackRemainingChain = getRemainingRequest(this).split("!"); | ||
const filePath = webpackRemainingChain[webpackRemainingChain.length - 1]; | ||
const options: Options = getOptions(this) as Options; | ||
return transform(code, options); | ||
return transform(code, {filePath, ...options}); | ||
} | ||
export = loader; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10482
147