Skip to content

Commit

Permalink
chore: refactor build for CDNJS Integration (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf authored Jan 5, 2024
1 parent be234de commit eb1facf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-goats-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels": minor
---

built new js file specifically for cdnjs integration
5 changes: 3 additions & 2 deletions packages/fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dist"
],
"scripts": {
"build": "tsup",
"build": "tsup && pnpm vite build",
"postbuild": "tsc --emitDeclarationOnly -p tsconfig.dts.json",
"prepublishOnly": "cp ../../README.md ./README.md"
},
Expand Down Expand Up @@ -85,7 +85,8 @@
},
"devDependencies": {
"@types/lodash.camelcase": "^4.3.7",
"@types/rimraf": "^3.0.2"
"@types/rimraf": "^3.0.2",
"vite": "^4.3.9"
},
"keywords": [
"ethereum",
Expand Down
18 changes: 18 additions & 0 deletions packages/fuels/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig } from 'vite';

export default defineConfig({
build: {
minify: true,
sourcemap: true,
emptyOutDir: false,
lib: {
entry: './src/index.ts',
name: 'browser',
formats: ['es'],
fileName: 'browser',
},
},
define: {
'process.env.NODE_ENV': JSON.stringify('production'),
},
});
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit eb1facf

Please sign in to comment.