[英]Build script of package.json
I have the below folder structure 我有以下文件夹结构
-src
--module
---some.js
---another.js
--server.js
I am using parceljs transpile the .js
files 我正在使用parceljs转换
.js
文件
The script in package.json
looks like this package.json
的脚本如下所示
"build": "parcel src/*/*.js --target=node"
When I run npm run build
, server.js
is not transpiled. 当我运行
npm run build
, server.js
不会被编译。
If I change the build script to the below, files in module
folder don't get transpiled 如果我将构建脚本更改为以下内容,则不会编译
module
文件夹中的文件
"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? 有什么指导,以便我可以在
src
级别转换.js
文件以及所有嵌套文件吗?
您可以使用逻辑运算符&&
在同一行中运行两个命令:
"build": "parcel src/*.js --target=node && parcel src/*/*.js --target=node"
根据@Jeremy的建议parcel src/**/*.js --target=node
。js parcel src/**/*.js --target=node
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.