Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Bundle postinstall script dependencies. #213

Merged

Conversation

hdeshev
Copy link
Contributor

@hdeshev hdeshev commented Nov 18, 2016

Fixes tns build errors. #211

Note that this solution has a small drawback -- plugin developer npm install calls will fail due to the postinstall script not being generated yet (generated in the prepublish hook). You can either ignore the error or use npm install --ignore-scripts

@EddyVerbruggen
Copy link
Owner

Hi,

When installing the plugin from this branch I get Cannot resolve module 'webpack'.

I naively added npm install webpack && to this bit in package.json:

  "scripts": {
    "bundle-installer": "npm install webpack && webpack --config scripts/webpack.config.js scripts/installer.js scripts/postinstall.js",

.. and ran the installer again, now getting this further down:

ERROR in ./scripts/installer.js
Module not found: Error: Cannot resolve module 'prompt' in /Users/eddyverbruggen/Downloads/nativescript-plugin-firebase-hdeshev-postinstall-bundle/scripts
 @ ./scripts/installer.js 3:13-30

So it seems like the dependencies listed in package.json don't get installed. Ideas?

@hdeshev
Copy link
Contributor Author

hdeshev commented Nov 19, 2016

npm install should get you the correct webpack version. I added it as a dev dependency.

@EddyVerbruggen
Copy link
Owner

@hdeshev I can indeed fix the problem by changing this line:

"bundle-installer": "webpack --config scripts/webpack.config.js scripts/installer.js scripts/postinstall.js",

to

"bundle-installer": "npm install --ignore-scripts && webpack --config scripts/webpack.config.js scripts/installer.js scripts/postinstall.js",

@EddyVerbruggen EddyVerbruggen merged commit 991a84d into EddyVerbruggen:master Nov 20, 2016
EddyVerbruggen added a commit that referenced this pull request Nov 20, 2016
EddyVerbruggen added a commit that referenced this pull request Nov 20, 2016
@EddyVerbruggen EddyVerbruggen added this to the 3.8.0 milestone Nov 20, 2016
EddyVerbruggen added a commit that referenced this pull request Apr 18, 2017
EddyVerbruggen added a commit that referenced this pull request Apr 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants