My project has this folder structure:
node
| .gitignore
| gulpfile.js
| package.json
| tsconfig.json
| webpack.config.js
|
+---build
| | debug.js
| | main.js
| |
| +---client
| | +---scripts
| | | bundle.js
| | |
| | \---views
| | index.html
| |
| |
| \---server
| | constants.js
| | server.js
| |
| \---router
| | constants.js
| | router.js
| |
| \---routes
| base.js
| index.js
|
+---gulp
| | constants.js
| |
| \---tasks
| default.js
| html.js
| typescript.js
|
\---src
| main.ts
|
+---client
| +---app
| | | app.tsx
| | |
| | \---components
| | hello.tsx
| |
| \---views
| index.html
|
\---server
| constants.ts
| server.ts
|
\---router
| constants.ts
| router.ts
|
\---routes
base.ts
index.ts
Gulp is used to copy HTML and compile TypeScript in build
folder maintaining folder structure. But I didn't found how to also bundle front-end code and node dependencies in order to make these avaiable in build/client
. After some suggestion and research I used Webpack to create bundle.js
.
Now I've the expected result but I wonder if there is a way to only Gulp or Webpack, in order to simplify the build process.