Answer the question
In order to leave comments, you need to log in
How to install Vue plugins in Bitrix?
I'm not a real front-end developer, so instructions like "run npm i package name" confuse me in general. Where is it generally done?
Those. it is clear that this should be done in the "project directory". But what is a "project directory" in real terms?
And even more so, I'm at a dead end as to how to do this in relation to bitrix. Those. I can make my own plugins, assemble them using the bitrix cli and connect them as extensions in terms of bitrix, but how can I do this with a third-party plugin?
Answer the question
In order to leave comments, you need to log in
Ahead of the answer, quit this thankless task)
youtube , better watch after reading the answer
I think the first two points are obvious, but I’ll write
1. Install node.js
Through the console
2. Install bitrix cli
npm install -g @bitrix/cli
Further, judging by the logic of the person from vidos if you don’t have a SPA, and you probably don’t have a SPA:
3. Create an extension for the vue (or other) plugin, in the console go to the folder /local/js/module_name/
bitrix create
answer the questions, the name of your extension should be without dots
4. Go to the folder with the extension, write
npm init
5. Download the desired plugin
npm i package name
check that it was added to package.json
6. Open bundle.config.js in the editor and add
plugins: {
resolve: true,
},
import React from 'react'
export {React}
\Bitrix\Main\UI\Extension::load("имя_модуля.имя_экстеншена")
import React from 'имя_модуля.имя_экстеншена';
loadExtension('имя_модуля.имя_экстеншена').then(() => {
// Код который использует `main.loader`
});
And where does Bitrix in general? It's just a backend that is no different from other backends. At least in Bitrix, at least where everything is installed, regardless of this.
The project directory is the directory in which the package.json file is located, in which the installation rules (what to install)
are written. If anything, I also never have a frontend.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question