0

I have the below folder structure

-src
--module
---some.js
---another.js
--server.js

I am using parceljs transpile the .js files

The script in package.json looks like this

"build": "parcel src/*/*.js --target=node"

When I run npm run build, server.js is not transpiled.

If I change the build script to the below, files in module folder don't get transpiled

"build": "parcel src/*.js --target=node"

Any guidance so what I could transpile .js files in the src level as well as all nested files?

neo-technoker
  • 369
  • 2
  • 8
  • 26
  • 1
    Does parcel take globs as inputs? If so it should be `parcel src/**/*.js --target=node` because the `**` will expand out directories and sub-directories. – Jeremy Nov 28 '18 at 21:00

2 Answers2

1

You could run the both commands in a single line, using the logical operator &&:

"build": "parcel src/*.js --target=node && parcel src/*/*.js --target=node"
reisdev
  • 3,215
  • 2
  • 17
  • 38
1

as per @Jeremy' suggestion parcel src/**/*.js --target=node

neo-technoker
  • 369
  • 2
  • 8
  • 26