New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bytenode-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bytenode-webpack-plugin - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

9

index.js

@@ -0,6 +1,10 @@

const Module = require('module')
const bytenode = require('bytenode')
require('v8').setFlagsFromString('--no-lazy')
class BytenodeWebpackPlugin {
constructor (options = {}) {
this.options = Object.assign({
compileAsModule: true,
keepSource: false

@@ -17,3 +21,6 @@ }, options)

// Compile them to v8 bytecode and emit them as .jsc files
const source = compilation.assets[filename]._value
let source = compilation.assets[filename]._value
if (this.options.compileAsModule) {
source = Module.wrap(source)
}
const bytecode = bytenode.compileCode(source)

@@ -20,0 +27,0 @@ compilation.assets[filename.replace('.js', '.jsc')] = {

4

package.json
{
"name": "bytenode-webpack-plugin",
"version": "1.0.1",
"version": "1.0.2",
"description": "Compiles JS files to V8 bytecode.",

@@ -13,3 +13,3 @@ "main": "index.js",

},
"author": "Aamir Syed <aamir@shardus.com>",
"author": "Aamir Syed <aamir@shardus.com>",
"license": "ISC",

@@ -16,0 +16,0 @@ "bugs": {

@@ -37,7 +37,8 @@ # Bytenode Webpack Plugin

| Name | Type | Default | Description |
|------------------|-----------|---------|----------------------------------------|
| **`keepSource`** | `boolean` | `false` | Keep JS source files in output or not. |
| Name | Type | Default | Description |
|-----------------------|-----------|---------|----------------------------------------------------------------|
| **`compileAsModule`** | `boolean` | `true` | Allow the resulting `.jsc` file to be used as a module or not. |
| **`keepSource`** | `boolean` | `false` | Keep JS source files in output or not. |
Here's an example that shows how to output both `.js` and `.jsc` files:
To use options:

@@ -55,2 +56,3 @@ ```javascript

new BytenodeWebpackPlugin({
compileAsModule: false,
keepSource: true

@@ -57,0 +59,0 @@ })

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