Answer the question
In order to leave comments, you need to log in
How to use developments in node that are not in the project folder?
Something like this structure:
наработки/some.js
проект1/package.json
проект1/node_modules/...
проект1/...
проект1/index.js
Answer the question
In order to leave comments, you need to log in
I decided as follows:
1. To use the developments in the webpack.config.js script itself, I registered the NODE_PATH=./node_modules environment variable in package.json:
{
"private": true,
"scripts": {
"dev-debug": "NODE_PATH=./node_modules node --inspect-brk ./node_modules/.bin/webpack --devtool none --mode development",
"prod-debug": "NODE_PATH=./node_modules node --inspect-brk ./node_modules/.bin/webpack --mode production",
"dev-server": "NODE_PATH=./node_modules ./node_modules/.bin/webpack serve --mode development",
"prod": "NODE_PATH=./node_modules ./node_modules/.bin/webpack --mode production"
},
resolve: {
alias: {
наработки: __dirname + "/../../../наработки",
},
modules: [__dirname + '/node_modules'], // - вот
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question