Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
webpack-env
Advanced tools
read variables from a .env.js file and make them available to webpack as globals
Webpack ENV is a webpack plug-in for creating ENV-variable-like globals in webpack.
First add Webpack Env as a webpack plug-in, using gulp this would look something like this:
//gulpfile.js
var gulp = require('gulp');
var webpack = require('webpack');
var webpackEnv = require('webpack-env');
gulp.task('webpack', function() {
return gulp.src('./entry.js')
.pipe(webpack({
output: {
filename: 'bundle.js'
},
plugins: [webpackEnv]
}))
.pipe(gulp.dest('build/'));
});
Create a .env.js
file in the same directory as your gulpfile.js.
This file should export an object that contains the eventual globals
you want your webpack code to contain:
module.exports = {
SOME_VAR: 'some val'
}
Weback Env also supports having multiple files for multiple environments.
To create a set of Production environment globals, just create a .production_env.js
file and run gulp with NODE_ENV set to 'production'.
Be sure you've added all your .env
files to your .gitignore
.
FAQs
read variables from a .env.js file and make them available to webpack as globals
The npm package webpack-env receives a total of 3,785 weekly downloads. As such, webpack-env popularity was classified as popular.
We found that webpack-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.