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.18 to 0.0.19

dist/components/auto-inc-version.js

3

dist/config.js
module.exports = {
NAME: 'Auto Inject Version',
SHORT: 'AIV'
SHORT: 'AIV',
PATH_PACKAGE: './package.json'
};
var chalk = require('chalk');
var fs = require('fs');
var path = require('path');
var config = require('./config');
'use strict';

@@ -8,5 +9,4 @@ var WebpackAutoInject = (function () {

this.options = WebpackAutoInject.options;
var packageFile = JSON.parse(fs.readFileSync(path.normalize('./package.json'), 'utf8'));
var packageFile = JSON.parse(fs.readFileSync(path.normalize(config.PATH_PACKAGE), 'utf8'));
this.version = packageFile.version;
console.log('versioooon: ' + this.version);
}

@@ -16,5 +16,9 @@ WebpackAutoInject.prototype.apply = function (compiler) {

if (this.options.injectIntoHtml) {
var comp_1 = new (require('./components/inject-into-html'))(this);
var comp_1 = new (require('./components/auto-inc-version'))(this);
comp_1.apply();
}
if (this.options.injectIntoHtml) {
var comp_2 = new (require('./components/inject-into-html'))(this);
comp_2.apply();
}
var comp = new (require('./components/inject-into-any-file'))(this);

@@ -24,3 +28,4 @@ comp.apply();

WebpackAutoInject.options = {
injectIntoHtml: true
autoIncrease: true,
injectIntoHtml: true,
};

@@ -27,0 +32,0 @@ return WebpackAutoInject;

{
"name": "webpack-auto-inject-version",
"version": "0.0.18",
"version": "0.0.19",
"description": "Webpack plugin for auto inject version from package.json",

@@ -14,3 +14,6 @@ "main": "dist/main.js",

"typings": "^1.4.0"
},
"dependencies": {
"semver": "^5.3.0"
}
}

@@ -1,1 +0,25 @@

# In development
# In development
# Installation
npm i webpack-auto-inject-version --save-dev
# Usage
Add plugin to your webpack configuration.
Require it by:
var WebpackAutoInject = require('webpack-auto-inject-version');
And add to plugins array as one of the last items ( further = better ).
plugins: [
new WebpackAutoInject(options)
]
# Options
NOT SUPPORTED YET!
autoIncrease : boolean,
injectIntoHtml : boolean,
# Auto Increase Version
Option: autoIncrease : true
- run webpack with --release major|minor|patch
DO NOT RUN IT WITH WATCH!
module.exports = {
NAME : 'Auto Inject Version',
SHORT : 'AIV'
SHORT : 'AIV',
PATH_PACKAGE : './package.json'
}

@@ -5,2 +5,3 @@ /// <reference path='../typings/index.d.ts' />

var path = require('path');
var config = require('./config');

@@ -16,3 +17,4 @@ 'use strict';

static options = {
injectIntoHtml : true
autoIncrease : true,
injectIntoHtml : true,
}

@@ -22,5 +24,4 @@

this.options = WebpackAutoInject.options;
var packageFile = JSON.parse(fs.readFileSync(path.normalize('./package.json'), 'utf8'));
var packageFile = JSON.parse(fs.readFileSync(path.normalize(config.PATH_PACKAGE), 'utf8'));
this.version = packageFile.version;
console.log('versioooon: ' + this.version);
}

@@ -32,2 +33,10 @@

// Component: auto-inc-version
// if: autoIncrease : true
if(this.options.injectIntoHtml) {
let comp = new (require('./components/auto-inc-version'))(this);
comp.apply();
}
// Component: Inject-into-html

@@ -34,0 +43,0 @@ // if: injectIntoHtml : true

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