Skip to content

Commit

Permalink
fix test & format
Browse files Browse the repository at this point in the history
  • Loading branch information
miyaji255 committed Jul 24, 2024
1 parent a487ef4 commit 920797b
Show file tree
Hide file tree
Showing 11 changed files with 26,085 additions and 26,028 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
pnpm-lock.yaml
60 changes: 35 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,41 @@ npm install --save-dev esbuild-plugin-gas-generator
How to use the plugin in your build script:

**build.js**

```javascript
const esbuild = require('esbuild');
const GasPlugin = require('esbuild-plugin-gas-generator');
const esbuild = require("esbuild");
const GasPlugin = require("esbuild-plugin-gas-generator");

esbuild.build({
entryPoints: ['src/index.js'],
esbuild
.build({
entryPoints: ["src/index.js"],
// Must be set to true
bundle: true,
// Must be set to 'esm'
format: 'esm',
format: "esm",

// Must be followed
outfile: 'dist/bundle.js',
outfile: "dist/bundle.js",
plugins: [GasPlugin()],
// Or
plugins: [GasPlugin({
// Or
plugins: [
GasPlugin({
// Specify the output file names
targets: ['dist/bundle.js']
})],
}).catch((e) => {
targets: ["dist/bundle.js"],
}),
],
})
.catch((e) => {
console.error(e);
process.exit(1);
});
});
```

**src/index.js**

```javascript
export function hello() {
console.log('Hello, World!');
console.log("Hello, World!");
}
```

Expand All @@ -52,22 +58,26 @@ export function hello() {
You can pass an object with options to the plugin:

```javascript
const esbuild = require('esbuild');
const GasPlugin = require('esbuild-plugin-gas-generator');
const esbuild = require("esbuild");
const GasPlugin = require("esbuild-plugin-gas-generator");

esbuild.build({
entryPoints: ['src/index.js', 'src/main.js'],
esbuild
.build({
entryPoints: ["src/index.js", "src/main.js"],
bundle: true,
format: 'esm',
outdir: 'dist',
plugins: [GasPlugin({
format: "esm",
outdir: "dist",
plugins: [
GasPlugin({
// Specify the output file names
targets: ['dist/index.js', 'dist/main.js']
})],
}).catch((e) => {
targets: ["dist/index.js", "dist/main.js"],
}),
],
})
.catch((e) => {
console.error(e);
process.exit(1);
});
});
```

## License
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"version": "1.1.0",
"scripts": {
"build": "tsup",
"test": "vitest --run"
"test": "vitest --run",
"fmt": "prettier --write ."
},
"main": "./dist/index.js",
"exports": {
Expand Down Expand Up @@ -43,7 +44,7 @@
"meriyah": "^4.5.0"
},
"devDependencies": {
"@types/node": "^20.14.11",
"@types/node": "^20.14.12",
"esbuild": "^0.23.0",
"esbuild-17": "npm:esbuild@^0.17.19",
"esbuild-18": "npm:esbuild@^0.18.20",
Expand All @@ -52,9 +53,10 @@
"esbuild-21": "npm:esbuild@^0.21.5",
"esbuild-22": "npm:esbuild@^0.22.0",
"esbuild-23": "npm:esbuild@^0.23.0",
"prettier": "^3.3.3",
"tsup": "^8.2.2",
"tsx": "^4.16.2",
"typescript": "^5.5.3",
"typescript": "^5.5.4",
"vitest": "^1.6.0",
"zod": "^3.23.8"
}
Expand Down
54 changes: 32 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 920797b

Please sign in to comment.