Skip to content

Commit eb1facf

Browse files
authored
chore: refactor build for CDNJS Integration (FuelLabs#1610)
1 parent be234de commit eb1facf

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

.changeset/pretty-goats-matter.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"fuels": minor
3+
---
4+
5+
built new js file specifically for cdnjs integration

packages/fuels/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"dist"
3636
],
3737
"scripts": {
38-
"build": "tsup",
38+
"build": "tsup && pnpm vite build",
3939
"postbuild": "tsc --emitDeclarationOnly -p tsconfig.dts.json",
4040
"prepublishOnly": "cp ../../README.md ./README.md"
4141
},
@@ -85,7 +85,8 @@
8585
},
8686
"devDependencies": {
8787
"@types/lodash.camelcase": "^4.3.7",
88-
"@types/rimraf": "^3.0.2"
88+
"@types/rimraf": "^3.0.2",
89+
"vite": "^4.3.9"
8990
},
9091
"keywords": [
9192
"ethereum",

packages/fuels/vite.config.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig } from 'vite';
2+
3+
export default defineConfig({
4+
build: {
5+
minify: true,
6+
sourcemap: true,
7+
emptyOutDir: false,
8+
lib: {
9+
entry: './src/index.ts',
10+
name: 'browser',
11+
formats: ['es'],
12+
fileName: 'browser',
13+
},
14+
},
15+
define: {
16+
'process.env.NODE_ENV': JSON.stringify('production'),
17+
},
18+
});

pnpm-lock.yaml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)