Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sucrase/webpack-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sucrase/webpack-loader - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

CHANGELOG.md

15

dist/index.js

@@ -1,10 +0,11 @@

"use strict";
const loader_utils_1 = require("loader-utils");
const sucrase_1 = require("sucrase");
"use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _loaderutils = require('loader-utils');
var _sucrase = require('sucrase');
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, Object.assign({ filePath }, options));
const webpackRemainingChain = (0, _loaderutils.getRemainingRequest)(this).split("!");
const filePath = webpackRemainingChain[webpackRemainingChain.length - 1];
const options = (0, _loaderutils.getOptions)(this) ;
return (0, _sucrase.transform)(code, {filePath, ...options}).code;
}
module.exports = loader;
{
"name": "@sucrase/webpack-loader",
"version": "1.0.2",
"version": "2.0.0",
"description": "Webpack loader for Sucrase",

@@ -10,7 +10,7 @@ "main": "dist/index.js",

"peerDependencies": {
"sucrase": "^1.12.1"
"sucrase": "^3"
},
"devDependencies": {
"@types/loader-utils": "^1.1.1",
"sucrase": "^1.12.1"
"sucrase": "^3.0.0"
},

@@ -17,0 +17,0 @@ "dependencies": {

@@ -9,7 +9,6 @@ # Sucrase Webpack loader

**Note: Sucrase does not transform object rest/spread syntax (e.g.
`{...a, b: c}`), and the syntax is not yet supported by Webpack. If you use that
syntax, you should use the
**Note: Object rest/spread syntax (e.g. `{...a, b: c}`) requires Webpack 4. For
earlier Webpack versions, you can use
[webpack-object-rest-spread-plugin](https://github.com/alangpierce/sucrase/tree/master/integrations/webpack-object-rest-spread-plugin)
package alongside this loader, and add both to your webpack config.**
alongside this loader.**

@@ -16,0 +15,0 @@ ## Usage

@@ -8,5 +8,5 @@ import {getOptions, getRemainingRequest} from "loader-utils";

const options: Options = getOptions(this) as Options;
return transform(code, {filePath, ...options});
return transform(code, {filePath, ...options}).code;
}
export = loader;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc