
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
rename-output-webpack-plugin
Advanced tools
Webpack plugin to rename outfile files / chunks generated by Webpack.
Webpack plugin to custom rename each outfile files / chunks generated during build.
Installation | Usage | License
npm install rename-output-webpack-plugin --save-dev
// webpack.config.js
const renameOutputPlugin = require('rename-output-webpack-plugin');
module.exports = {
entry: {
'core': './src/core.js',
'app': './src/index.js',
'jquery': ['jquery'],
'angular-suite': ['angular', 'angular-ui-bootstrap', 'angular-ui-router'],
},
output: {
'filename': '[name]-[id].js',
'path': path.resolve(__dirname, 'dist')
},
plugins: [
new renameOutputPlugin({
'core': 'framework-[hash].js',
'jquery': '[name]-[version].min.js',
'angular-suite': '[name]-[version@angular].min.js'
})
]
};
This configuration will generate following files:
Hash: 7aa4bcb22d7fa4791dd8
Version: webpack 3.8.1
Time: 1812ms
Asset Size Chunks Chunk Names
app-0.js 2.08 MB 0 [emitted] [big] app
angular-suite-1.6.6.min.js 1.73 MB 1 [emitted] [big] angular-suite
jquery-3.2.1.min.js 271 kB 2 [emitted] [big] jquery
framework-7aa4bcb22d7fa4791dd8.js 271 kB 3 [emitted] [big] core
In Webpack configuration (webpack.config.js), output.filename supports following substitutions:
This plugin adds one more substitution [version]. [version] allow you to use version of dependency within your output bundle filename. For e.g. If you are using jquery and chunking it separately, you can add [version] to ensure right version (from jquery module package.json) is added within output filename.
module.exports = {
entry: {
'jquery': ['jquery']
},
...
plugins: [
new renameOutputPlugin({
'jquery': '[name]-[version].min.js'
})
]
};
Asset Size Chunks Chunk Names
jquery-3.2.1.min.js 271 kB 2 [emitted] [big] jquery
This project is licensed under the MIT License - see the LICENSE file for details
FAQs
Webpack plugin to rename outfile files / chunks generated by Webpack.
The npm package rename-output-webpack-plugin receives a total of 35 weekly downloads. As such, rename-output-webpack-plugin popularity was classified as not popular.
We found that rename-output-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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.