我制作了一个有3个块的WordPress插件。包裹。json如下所示:
"scripts": {
"build": "wp-scripts build",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"start": "wp-scripts start",
"packages-update": "wp-scripts packages-update",
"build:review-box": "wp-scripts build blocks/review-box/src/index.js --output-path=blocks/review-box/build/",
"start:review-box": "wp-scripts start blocks/review-box/src/index.js --output-path=blocks/review-box/build/",
"build:random-game": "wp-scripts build blocks/random-game/src/index.js --output-path=blocks/random-game/build/",
"start:random-game": "wp-scripts start blocks/random-game/src/index.js --output-path=blocks/random-game/build/",
"build:game-list": "wp-scripts build blocks/game-list/src/index.js --output-path=blocks/game-list/build/",
"start:game-list": "wp-scripts start blocks/game-list/src/index.js --output-path=blocks/game-list/build/"
},
"dependencies": {
"@wordpress/block-editor": "^8.0.13",
"@wordpress/blocks": "^11.1.5",
"@wordpress/i18n": "^4.2.4"
},
"devDependencies": {
"@wordpress/scripts": "^19.2.2"
}
运行此操作时:
npm run start:random-game
我只看到这个输出,其他什么都看不到:
> [email protected] start:random-game
> wp-scripts start blocks/random-game/src/index.js --output-path=blocks/random-game/build/
在我可以使用npm run start:random game或npm run build:game list为每个博客构建和运行脚本之前,发生了如下情况:
asset index.js 2.93 KiB [emitted] [minimized] (name: index)
asset index.asset.php 192 bytes [emitted] (name: index)
Entrypoint index 3.12 KiB = index.js 2.93 KiB index.asset.php 192 bytes
这在以前很好用,现在在任何其他古腾堡插件上都很好用。我错过了什么?我试过了;npm安装@wordpress/scripts--保存开发”;但有些东西似乎坏了。这是存储库:
https://github.com/mtoensing/game-review-block