VvvebJs icon indicating copy to clipboard operation
VvvebJs copied to clipboard

Question: Webpack configuration

Open eddielee394 opened this issue 5 years ago • 4 comments

Awesome package. I'm planning on integrating it with an existing Laravel application. Are there any special requirements to configure the package (and it's dependencies) as part of a webpack/mix build?

eddielee394 avatar Mar 19 '19 14:03 eddielee394

Thank you, you only need to configure sass to compile files from scss/ folder to css/ no dependencies needed except Bootstrap and jQuery but they are bundled to make it easier to use without the need to use any build system.

givanz avatar Mar 23 '19 12:03 givanz

Thanks for the reply. I did see that it's bundled with the js dependencies, but we already have a build system that's part of our deployment & dev workflow. Adding a separate instance of bootstrap4 & jquery is bound to cause conflicts, so we ended up having to remove the bundled styles & js files.
It'd be great if that was all handled via a package.json as part of the npm package (which i don't believe is up to date with the latest release from the repo) instead of just bundling the dependency files with the plugin src, as build process may differ from use case to use case. At least that way, npm can handle whether a dependency should be installed or not.

eddielee394 avatar Mar 25 '19 14:03 eddielee394

I want to keep it very simple and avoid adding a build system as currently there are only a few dependencies and there is only a scss > css conversion needed if css changes are made.

I also like the fact that the code can be downloaded and used right away without installing anything, the html can be opened in the browser and it works as it is without the need of anything else like a http server or build system.

Changing Bootstrap and jQuery paths to a vendor/ path to make use of a build system should be easy.

givanz avatar Mar 31 '19 15:03 givanz

I having a hard time configuring Vvveb with webpack(webpacker). I have required the builder.js in application.js

require("vvvebjs/libs/builder/builder.js")
require("vvvebjs/libs/builder/undo.js")
undo.js:52 Uncaught ReferenceError: Vvveb is not defined
    at Object../node_modules/vvvebjs/libs/builder/undo.js (undo.js:52)
    at __webpack_require__ (bootstrap:19)
    at Module.<anonymous> (application.js:37)
    at Module../app/javascript/packs/application.js (application.js:61)
    at __webpack_require__ (bootstrap:19)
    at bootstrap:83
    at bootstrap:83

Any reference implementation would greatly help the community.

amitsavani avatar Jan 26 '21 04:01 amitsavani