Skip to content

Commit

Permalink
treeshake and skipNodeModulesBundle (#402)
Browse files Browse the repository at this point in the history
* treeshake and skipNodeModulesBundle

* add to CHANGELOG

* tsup clean is not clean enough

* notes for future self

* Apply suggestions from code review

Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com>

* remove watch because we arent a app

---------

Co-authored-by: mix irving <mix@protozoa.nz>
Co-authored-by: Nayyir Jutha <nayyir.jutha@gmail.com>
  • Loading branch information
3 people authored Jul 23, 2024
1 parent ead8b92 commit 5747da9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Version header format: `[version] Name - year-month-day (entropy-core compatibil
### Broke

### Dev

- no longer building node modules into dist
### Meta


Expand Down
5 changes: 5 additions & 0 deletions index.cjs
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
// this is here to make the exports less "messy"
// and also if you dont know about package.json you can
// still import or require see test tests/require.test.cjs
// next time you look at the build system
// ask your self is node done with require?
module.exports = require('./dist/index.cjs')
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"lint:eslint": "eslint . --ext .ts --fix",
"peek": "tsc --build --clean",
"burn": "rm -Rf node_modules && yarn cache clean --all && yarn install",
"build": "tsup",
"build:watch": "tsup --watch",
"build": "rm -rf dist && tsup",
"build:node": "tsup --platform node ",
"build:browser": "tsup --platform browser",
"build:link": "yarn build && yarn unlink && yarn link",
Expand Down
3 changes: 2 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export default defineConfig((options) => {
'src/utils/index.ts',
'src/utils/crypto/index.ts',
],
treeshake: true,
skipNodeModulesBundle: true,
replaceNodeEnv: true,
format: ['esm', 'cjs'],
dts: true,
Expand All @@ -17,6 +19,5 @@ export default defineConfig((options) => {
clean: true,
target: 'es2022',
minify: options.minify,
watch: options.watch,
}
})

0 comments on commit 5747da9

Please sign in to comment.