Skip to content

postinstall build not work when adding to another project dependency #37

@xxhenglyxx

Description

@xxhenglyxx

I tried clone my project and then run npm install, the postinstall build runs fine, also my production script runs fine alone. Except when I adding it to my another project to use as an library.
Here is my package.json

{
    ...
    "main": "dist/bundle.js",
    "files": [
        "dist/"
     ],
     "scripts": {
     "start": "webpack-dev-server",
     "clean": "rimraf dist",
     "production": "cross-env npm run clean && webpack --config webpack.production.config.js --progress --profile --colors",
    "test": "jest",
    "postinstall": "postinstall-build dist --script production",
    "dependencies": {
    "cross-env": "5.1.4",
    "lodash": "^4.17.5",
    "postinstall-build": "^5.0.1",
    "prop-types": "^15.6.1",
    "react": "16.3.2",
   "react-dom": "16.3.2",
    "react-hot-loader": "4.1.0",
    "react-router-dom": "4.2.2"
  },
  "devDependencies": {
    "babel-cli": "6.26.0",
    "babel-core": "6.26.0",
    "babel-eslint": "8.2.3",
    "babel-jest": "22.4.1",
    "babel-loader": "7.1.4",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-env": "^1.6.1",
    "babel-preset-es2015": "6.24.1",
    "babel-preset-react": "6.24.1",
    "babel-preset-react-boilerplate": "1.1.1",
    "babel-preset-react-hmre": "1.1.1",
    "babel-preset-stage-3": "^6.24.1",
    "copy-webpack-plugin": "4.5.1",
    "css-hot-loader": "1.3.9",
    "css-loader": "0.28.11",
    "enzyme": "3.3.0",
    "enzyme-adapter-react-16": "1.1.1",
    "eslint": "4.19.0",
    "eslint-config-airbnb": "16.1.0",
    "eslint-loader": "2.0.0",
    "eslint-plugin-import": "2.11.0",
    "eslint-plugin-jsx-a11y": "6.0.3",
    "eslint-plugin-react": "7.6.0",
    "extract-text-webpack-plugin": "3.0.2",
    "file-loader": "1.1.10",
    "html-webpack-plugin": "3.2.0",
    "husky": "0.15.0-rc.2",
    "jest": "22.1.0",
    "node-sass": "4.8.3",
    "open-browser-webpack-plugin": "0.0.5",
    "react-addons-test-utils": "15.6.2",
    "react-test-renderer": "16.3.2",
    "rimraf": "2.6.2",
    "sass-loader": "6.0.7",
    "style-loader": "0.20.3",
    "url-loader": "1.0.0",
    "webpack": "3.11.0",
    "webpack-dev-server": "2.9.6"
    }
},

the error
a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions