packages-versions-webpack-plugin
this package create a text file that contain the correct dependencies of the project
this plugin create a
version.txt
file in theentry
folder that contain the current packages that install on the project
install this plugin
npm install --save-dev packages-versions-webpack-plugin
- in the
webpack.config.js
var PackagesVersionsPlugin = require('packages-versions-webpack-plugin');
- in the plugin section
var webpackConfig = {
...
plugins: [
...
new PackagesVersionsPlugin(),
...
],
...
};
using this plugin in the code
this plugin can be using in the code using raw-loader
like so
console.info(require('!!raw-loader!./versions.txt'));
notice that you need to install raw-loader in order to use this snippet
version releases
1.0.5
- create the
versions.txt
only on the creating of the plugin (a.k.a. first webpack build)
1.0.4
- bug fix, change
path
topath2VersionTxt
1.0.3
- add support to Angular2, if there is an
entry.app
then put theversion.txt
there.
1.0.2
- use try and catch in the creating of the
version.txt
in order to dismissnpm ls
error like peer dependencies - update README.md file