Socket
Socket
Sign inDemoInstall

optimize-js-plugin

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

optimize-js-plugin - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

44

lib/index.js

@@ -28,28 +28,28 @@ 'use strict';

var jsregex = /\.js($|\?)/i;
var jsRegex = /\.js($|\?)/i;
compiler.plugin('emit', function (compilation, callback) {
compilation.chunks.forEach(function (chunk) {
var files = [];
compiler.plugin('compilation', function (compilation) {
compilation.plugin("after-optimize-chunk-assets", function (chunks) {
chunks.forEach(function (chunk) {
var files = [];
chunk.files.forEach(function (file) {
return files.push(file);
});
chunk.files.forEach(function (file) {
return files.push(file);
files.filter(function (file) {
return jsRegex.test(file);
}).forEach(function (file) {
try {
var asset = compilation.assets[file];
var input = asset.source();
var result = optimizeJs(input, {
sourceMap: !!_this.options.sourceMap
});
compilation.assets[file] = new RawSource(result);
} catch (e) {
compilation.errors.push(e);
}
});
});
files.filter(function (file) {
return jsregex.test(file);
}).forEach(function (file) {
try {
var asset = compilation.assets[file];
var input = asset.source();
var result = optimizeJs(input, {
sourceMap: !!_this.options.sourceMap
});
compilation.assets[file] = new RawSource(result);
} catch (e) {
compilation.errors.push(e);
}
});
});
callback();
});

@@ -56,0 +56,0 @@ }

{
"name": "optimize-js-plugin",
"version": "0.0.3",
"version": "0.0.4",
"description": "webpack plugin to optimize initial JavaScript execution/parsing by wrapping eager functions",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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