Giter Club home page Giter Club logo

Comments (4)

weaverryan avatar weaverryan commented on July 24, 2024 2

I've got this issue over here: symfony/flex#843

What I find really useful to do, in in my package.json I put packages that are for building the front-end in devDependencies, and then stuff that is used in the actual execution of the front-end in dependencies.

I agree. That is actually why the packages are added to devDependencies. If you install something like ux-chartjs, its npm package is added to devDependencies. That may seem incorrect at first, but that dependency only needs to be present during build. Encore uses it - at build time - to create the final, built CSS and JS files. That package does NOT need to be present at runtime. So, I think your philosophy is correct and the packages are already following it.

from ux.

mmarton avatar mmarton commented on July 24, 2024

friendly cc @tgalopin

from ux.

BigMichi1 avatar BigMichi1 commented on July 24, 2024

I see some similar behaviour every time I run composer update the versions in package.json are getting updated. for example, I have "symfony/ux-chartjs": "1.3.0" installed so in package.json there is the dependency written for chart.js which I upgraded to a newer version

"chart.js": "3.6.0",

after running the composer command it is changed to

"chart.js": "^2.9.4",

would be nice if this change can somehow be avoided/suppressed

from ux.

benr77 avatar benr77 commented on July 24, 2024

I'm experiencing a related issue. I have a standard Symfony type app, which outputs HTML via Twig templates. I then use Webpack Encore to build the client side assets.

What I find really useful to do, in in my package.json I put packages that are for building the front-end in devDependencies, and then stuff that is used in the actual execution of the front-end in dependencies.

Now I realise technically for my kind of build this is irrelevant, as it all gets built by Webpack and outputted to the build directory anyway, presumably with whatever tree-shaking is needed to avoid getting the JS build tools in the final dist version.

However, I find it very useful to do this, as it distinguishes the two types of package.

Installing Symfony UX always adds stuff to the devDependencies section, whereas it is all runtime stuff, so personally I would much prefer that it targetted the main dependencies section instead.

Is there a good reason for adding to devDependencies ?

from ux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.