Invoke webpack or npm run from NodeServices? #176

Closed
opened 2025-08-09 17:15:17 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @zolakt on 2/12/2018

Hi,

I have a theme system, that is editable through the UI. After a theme is edited I need to run webpack with a config script to generate css files from scss at runtime.

Is it in any way possible to invoke webpack from NodeServices manually?

I've tried:
nodeServices.InvokeAsync<int>("webpack --config ./webpack.config.themes.js --env.prod")
nodeServices.InvokeAsync<int>("./node_modules/webpack/bin/webpack.js --config ./webpack.config.themes.js --env.prod")
nodeServices.InvokeAsync<int>("npm run webpack:themes")

Nothing seems to work.
I'm getting this exception

NodeInvocationException: Cannot find module

Btw. I have a corresponding "webpack:themes" script in package.json
"scripts": { "webpack:themes": "webpack --config webpack.config.themes.js" }

*Originally created by @zolakt on 2/12/2018* Hi, I have a theme system, that is editable through the UI. After a theme is edited I need to run webpack with a config script to generate css files from scss at runtime. Is it in any way possible to invoke webpack from NodeServices manually? I've tried: `nodeServices.InvokeAsync<int>("webpack --config ./webpack.config.themes.js --env.prod")` `nodeServices.InvokeAsync<int>("./node_modules/webpack/bin/webpack.js --config ./webpack.config.themes.js --env.prod")` `nodeServices.InvokeAsync<int>("npm run webpack:themes")` Nothing seems to work. I'm getting this exception > NodeInvocationException: Cannot find module Btw. I have a corresponding "webpack:themes" script in package.json ` "scripts": { "webpack:themes": "webpack --config webpack.config.themes.js" }`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#176
No description provided.