You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
Creating project in Sidekick leaves it without webpack.config and hooks in some cases, but the template has a dependency to nativescript-dev-webpack.
Steps to reproduce
Create new project in Sidekick
Build the project
Create another project
Check the latest project you've created - it does not have webpack.config.js and several hooks are missing
The problem is that once a project is built, the INIT_CWD environment variable is set to the project directory of the project. When creating a new project after that, the INIT_CWD still points to the same location. The new project has a dependency to nativescript-hook which respects the INIT_CWD variable. After that it detects that all hooks are already installed in the searched location (the first project) and doesn't do anything. So the new project does not receive the required hooks. Same is valid for webpack.config.js - nativescript-hook respects the INIT_CWD variable and returns the value for a project dir. The postinstall of nativescript-dev-webpack detects there's webpack.config.js in the path returned from nativescript-hook and doesn't add a new one.
The main problem is that we set the value of INIT_CWD in the nativescript-dev-webpack hooks. We should just read it and use it when npm CLI has set it.
Local environment
Platform: all
Node version 6.x.x IMPORTANT: Your npm version should be 3.x.x or 4.x.x
Issue Checklist
Tell us about the problem
Creating project in Sidekick leaves it without webpack.config and hooks in some cases, but the template has a dependency to nativescript-dev-webpack.
Steps to reproduce
The problem is that once a project is built, the INIT_CWD environment variable is set to the project directory of the project. When creating a new project after that, the INIT_CWD still points to the same location. The new project has a dependency to nativescript-hook which respects the INIT_CWD variable. After that it detects that all hooks are already installed in the searched location (the first project) and doesn't do anything. So the new project does not receive the required hooks. Same is valid for webpack.config.js - nativescript-hook respects the INIT_CWD variable and returns the value for a project dir. The postinstall of nativescript-dev-webpack detects there's webpack.config.js in the path returned from nativescript-hook and doesn't add a new one.
The main problem is that we set the value of INIT_CWD in the nativescript-dev-webpack hooks. We should just read it and use it when npm CLI has set it.
Local environment
Project data
The text was updated successfully, but these errors were encountered: