Skip to content

Commit fabd543

Browse files
committed
🚧 Update build scripts
1 parent f33a389 commit fabd543

File tree

5 files changed

+10
-251
lines changed

5 files changed

+10
-251
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Things you'll need installed before you can setup the development environment
6363
```ts
6464
/// <reference types="blockbench-types"/>
6565
```
66-
4. Run `yarn build:dev` to start the development environment, which will watch for changes and recompile the plugin.
66+
4. Run `yarn dev` to start the development environment, which will watch for changes and recompile the plugin.
6767
5. Open Blockbench, then go to `File > Plugins > Load Plugin From File` and select the `animated_java.js` file from your local repo (`dist/pluginPackage/animated-java.js`).
6868
6. That's it! You're ready to start developing.
6969

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
"private": true,
6464
"scripts": {
6565
"build:scripts": "esbuild --bundle --platform=node --outfile=dist/build.cjs --packages=external ./tools/esbuild.ts",
66-
"build:dev": "yarn build:scripts && node ./dist/build.cjs --mode=dev",
67-
"build:prod": "yarn build:scripts && node ./dist/build.cjs",
66+
"dev": "yarn build:scripts && node ./dist/build.cjs --mode=dev",
67+
"prod": "yarn build:scripts && node ./dist/build.cjs",
6868
"format": "prettier --write ."
6969
},
7070
"devDependencies": {

tools/esbuild.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ if (process.argv.includes('--mode=dev')) {
77
process.env.FLAVOR ??= `local`
88

99
import * as fs from 'fs'
10-
import { readFile } from 'fs-extra'
1110
import { isAbsolute, join } from 'path'
1211
import { TextDecoder } from 'util'
1312
import { load } from 'js-yaml'
@@ -19,7 +18,7 @@ import ImportGlobPlugin from 'esbuild-plugin-import-glob'
1918
import packagerPlugin from './plugins/packagerPlugin'
2019
import inlineWorkerPlugin from './plugins/workerPlugin'
2120
import assetOverridePlugin from './plugins/assetOverridePlugin'
22-
import path from 'path'
21+
import * as path from 'path'
2322
const PACKAGE = JSON.parse(fs.readFileSync('./package.json', 'utf-8'))
2423

2524
const INFO_PLUGIN: esbuild.Plugin = {
@@ -161,7 +160,7 @@ const yamlPlugin: (opts: {
161160
}
162161
})
163162
build.onLoad({ filter: /.*/, namespace: 'yaml' }, async args => {
164-
const yamlContent = await readFile(args.path)
163+
const yamlContent = await fs.promises.readFile(args.path)
165164
let parsed = load(new TextDecoder().decode(yamlContent), options?.loadOptions)
166165
if (options?.transform && options.transform(parsed, args.path) !== void 0)
167166
parsed = options.transform(parsed, args.path)

tools/plugins/workerPlugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-env node */
2-
import esbuild from 'esbuild'
2+
import * as esbuild from 'esbuild'
33
import findCacheDir from 'find-cache-dir'
4-
import fs from 'fs'
5-
import path from 'path'
4+
import * as fs from 'fs'
5+
import * as path from 'path'
66

77
export { inlineWorkerPlugin as default }
88

0 commit comments

Comments
 (0)