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
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(),
...
],
...
};
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
- create the
versions.txt
only on the creating of the plugin (a.k.a. first webpack build)
- bug fix, change
path
topath2VersionTxt
- add support to Angular2, if there is an
entry.app
then put theversion.txt
there.
- use try and catch in the creating of the
version.txt
in order to dismissnpm ls
error like peer dependencies - update README.md file