Skip to content

Commit

Permalink
add postinstall message
Browse files Browse the repository at this point in the history
  • Loading branch information
nimaa77 committed Jan 22, 2020
1 parent c59a6d7 commit 50650e6
Show file tree
Hide file tree
Showing 3 changed files with 2,529 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Razzle plugin to add webpack-bundle-analyzer",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "node postinstall.js"
},
"repository": {
"type": "git",
Expand All @@ -23,6 +24,7 @@
},
"homepage": "https://github.com/nimacsoft/razzle-plugin-bundle-analyzer#readme",
"dependencies": {
"print-message": "^3.0.1",
"webpack": "~4.0.0",
"webpack-bundle-analyzer": ">=3.6.0"
}
Expand Down
25 changes: 25 additions & 0 deletions postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const printMessage = require("print-message");

printMessage(
[
"To enable Razzle Bundle Analyzer create `razzle.config.js` file in root of your project",
"and put this in it:",
"",
"module.exports = {",
" plugins: ['bundle-analyzer']",
"};",
"",
"then, add this script to your scripts in package.json:",
"",
"\"analyze\": \"BUNDLE_ANALYZE=true razzle build\"",
"",
"finnaly run analyze command with npm or yarn:",
"`npm run analyze` or `yarn analyze`"
],
{
border: true,
borderColor: "yellow",
marginTop: 3,
marginBottom: 3
}
);
Loading

0 comments on commit 50650e6

Please sign in to comment.