I suppose this problem will be applicable to other frameworks that have few ecosystems of plugins / components that rely on specific building tools (React components with JSX, etc.). Vue is just my use case.
I created several Vue components as separate files .vuethat are published to NPM. package.jsonthis component does not list any dependencies, since they themselves are designed to work in the parent project, which uses webpack, vue-loader, sass-loader, etc. This is an example of one of these components .
.vue
package.json
I'm not sure of the best way to declare that these components rely on the parent package with the specified build tools. I’m not sure what devDependenciesis the right place for them, since the component itself does not have a development step that relies on them. peerDependenciesseems to be more appropriate, but again I’m not sure if this correctly matches what I am trying to achieve.
devDependencies
peerDependencies
Looking through many components in awesome-vue , I see no use peerDependenciesand devDependenciesseem relevant for the development of specific components themselves.
What is the correct way to create these components? It's almost like I need something like " peerDevDependencies".
peerDevDependencies
, , .
, main raw .vue .
main
, - , , , , , Browserify Rollup ( Webpack). raw .vue .vue , , Vue, ( ).
, , , , Vue <script>. , , Vue peerDependency , .
<script>
Vue
peerDependency
package.json, CDN , , , .
Vue.js, , peerDependencies . , , , . devDependencies , .
"module" package.json raw vue "main" . module - , , webpack rollup .
"module"
"main"
module
. s npm.
Source: https://habr.com/ru/post/1015951/More articles:My SQL query takes too long when using a non-clustered index - sqlHow can I stop empty XML elements self closing with XmlDocument in C #? - c #Why is this not a valid CSS selector using querySelectorAll in JS? - javascriptNSOpenPanel Swift warning message on OSX 10.12 - swift3How to pass identifiers for hasMany relationships using store.createRecord ()? - ember.jsswift + OS X sandboxing: обрабатывать "NSVBOpenPanel" как "NSOpenPanel":: поскольку мне нужно получить отправителя в методе делегирования - swiftPrevent response body loading in python async http requests - pythonХорошая ли скорость обучения для метода Адама? - deep-learningSelect2 autocomplete by parameter value - javascriptpackage installation error - your package only supports platforms [], but your local platforms - ["ruby", "x86_64-linux"] - ruby | fooobar.comAll Articles