frontend-maven-plugin icon indicating copy to clipboard operation
frontend-maven-plugin copied to clipboard

New Mojo to run node with arbitrary arguments

Open cmarchand opened this issue 4 years ago • 2 comments
trafficstars

New Mojo to execute arbitrary node commands

As explained in issue #996 I need a new Mojo to run node command with arbitrary parameters

Tests and Documentation

README.md contains an example to use NodeMojo plugin.

cmarchand avatar Aug 30 '21 21:08 cmarchand

A few people have asked for this feature, but perhaps not many enough. What people usually do is npm run your-script from Maven, and then in package.json add "your-script": "node something.js" inside the scripts block. You then get the additional benefit of being able to do npm run your-script directly from the command line (without Maven) which can be convenient if your command is somewhat complex (node some/kind/of/script.js --foo bar ./bla --etc).

eirslett avatar Aug 31 '21 08:08 eirslett

Yes, that's a solution. In my situation, at this point, I do not have anymore need of npm, so adding a package.json in my maven project is not very useful. But yes, it's a good workaround. Thanks.

cmarchand avatar Aug 31 '21 09:08 cmarchand