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

webpack-auto-inject-version

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-auto-inject-version - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

dist/components/inject-into-html.js

29

dist/main.js
var chalk = require('chalk');
var fs = require('fs');
var path = require('path');
function ProjectVersionInject(options) { }
var getVersion = function () {
var package = JSON.parse(fs.readFileSync(path.normalize('./package.json'), 'utf8'));
return package.version;
};
ProjectVersionInject.prototype.apply = function (compiler) {
compiler.plugin('emit', function (compilation, cb) {
});
};
module.exports = ProjectVersionInject;
var WebpackAutoInject = (function () {
function WebpackAutoInject(options) {
this.options = WebpackAutoInject.options;
var packageFile = JSON.parse(fs.readFileSync(path.normalize('./package.json'), 'utf8'));
this.version = packageFile.version;
}
WebpackAutoInject.prototype.apply = function (compiler) {
this.compiler = compiler;
if (this.options.injectIntoHtml) {
var comp = new (require('./components/inject-into-html'))(this);
comp.apply();
}
};
WebpackAutoInject.options = {
injectIntoHtml: true
};
return WebpackAutoInject;
}());
module.exports = WebpackAutoInject;
{
"name": "webpack-auto-inject-version",
"version": "0.0.11",
"version": "0.0.12",
"description": "Webpack plugin for auto inject version from package.json",

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

@@ -8,15 +8,27 @@ /// <reference path='../typings/index.d.ts' />

constructor(options) {
private options;
private compiler;
private version;
static options = {
injectIntoHtml : true
}
static getVersion = function(){
var package = JSON.parse(fs.readFileSync(path.normalize('./package.json'), 'utf8'));
return package.version;
constructor(options) {
this.options = WebpackAutoInject.options;
var packageFile = JSON.parse(fs.readFileSync(path.normalize('./package.json'), 'utf8'));
this.version = packageFile.version;
}
protected apply(compiler) {
compiler.plugin('emit', function(compilation, cb) {
});
this.compiler = compiler;
// Component: Inject-into-html
// if: injectIntoHtml : true
if(this.options.injectIntoHtml) {
let comp = new (require('./components/inject-into-html'))(this);
comp.apply();
}
}

@@ -23,0 +35,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