Build a submodule in another path

I have a site linked to github, and the build go to root path, this build is OK, but I need a root “/” build and a new build inside it, in a new path like “/new_path”, I am trying add a gitmodule, but I don’t understand if it is correctly or how to init a build of a gitmodule.

My package.json:
“name”: “my-themes-engine”,
“version”: “1.0.0”,
“main”: “index.js”,
“license”: “MIT”,
“scripts”: {
“start”: “./node_modules/webpack/bin/webpack.js --watch --progress --color --mode=development --config webpack.config.js”,
“start:dev”: “webpack-dev-server”,
“build:dev”: “./node_modules/webpack/bin/webpack.js --env.development --bail -p --mode=development --config webpack.config.js”,
“build”: “./node_modules/webpack/bin/webpack.js --env.production --bail -p --mode=production --config webpack.config.js”,
“test”: “jest”

My .gitmodule:
[submodule “new_path”]
path = new_path
url =
branch = another-branch

someone has a tip to me?

I have to admit I don’t quite understand your goal - usually a submodule is used as part of your build, not as its own build, though you can run anything you like as a build command (such as command1 && command2 to run command2 only if command1 is successful).

I only really know about the standard submodule setups - where you’d import something to a path within your repo, and then “use it” later. You can of course cd path/to/submodule && build-it && cd - && npm run build:dev or some pattern like that, if it helps?

If not, could you try showing exactly the series of steps you use to build locally using the submodule?