Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cssrename-webpack-plugin
Advanced tools
npm install --save cssrename-webpack-plugin
Recommended to use with cssrename-loader
webpack.config.js
:
const HTMLWebpackPlugin = require('html-webpack-plugin');
const CssRenameWebpackPlugin = require('cssrename-webpack-plugin');
const webpack = require('webpack');
var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
});
var CssRenameWebpackPluginConfig = new CssRenameWebpackPlugin();
module.exports = {
entry: {
app: [
'./app/js/index.js'
]
},
output: {
path: __dirname + '/dist',
filename: 'index.js'
},
module: {
loaders: [
{
test: /\.js?$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.less$/,
loader: "style-loader!css-loader!cssrename-loader!less-loader?config=lessLoaderCustom"
}
]
},
plugins: [
HTMLWebpackPluginConfig,
CssRenameWebpackPluginConfig
]
};
cssrename-loader
- would rename you css classes in your styles
Example:
.bold {
font-weight: bolder;
}
=>
.___bold__ {
font-weight: bolder;
}
In your js files you should use three underscore before class name and two underscore after.
Backbone example:
var ButtonComponent = require('./Button');
module.exports = Backbone.View.extend({
tagName: 'div',
className: '___alert-box__',
template: _.template(
'<div class="___alert-block__"><div class="___alert-message__"><%= text %></div></div>'
),
render: function () {
this.$el.html(this.template(this.model.toJSON()));
this.button_ = new ButtonComponent({
title: 'OK',
cb: this.close.bind(this)
});
this.$el.find('.___alert-block__').append(this.button_.render().$el);
return this;
},
close: function(){
this.button_.close();
this.remove();
this.unbind();
this.model.unbind("change", this.modelChanged);
}
});
React example:
class HelloMessage extends React.Component {
render() {
return <div className="___hello__">Hello {this.props.name}</div>;
}
}
ReactDOM.render(<HelloMessage name="John" />, mountNode);
FAQs
CSS class names minimization
The npm package cssrename-webpack-plugin receives a total of 0 weekly downloads. As such, cssrename-webpack-plugin popularity was classified as not popular.
We found that cssrename-webpack-plugin 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.