Stimulus Discourse

What is the command to build stimulus project for production


#1

I try the project at the weekends and I really like it. However, I’m missing the command to build the project for production usage ( regarding uglify, minify javascript … ). Does it come from webpack or I miss something here?


#2

I presume that most people use it together with Rails and webpacker which does this for you. Also, I’m not sure if there is any other tooling for Stimulus, but I might be wrong.


#3

Thanks for pointing out. I think it would be nice that we can build for stand alone project.


#4

I want to use it with Phoenix. Is there a way to build for production (outside of Rails)?


#5

You can build for standalone project by adding "build": "webpack --mode production" to "scripts" inside package.json , then running yarn build. I assume you’re using webpack.