Skip to content

Commit

Permalink
Update tsup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lu Nguyen committed Sep 21, 2023
1 parent 8315c14 commit cc8b2aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
"wagmi": "^1.3.2"
},
"scripts": {
"dev": "tsup --watch --onSuccess 'yalc push --changed --no-scripts'",
"dev": "NODE_ENV=development tsup --watch",
"build": "tsup",
"lint": "eslint --fix \"src/**/\"",
"lint:check": "eslint \"src/**/\"",
"lint:nowarns": "eslint --quiet \"src/**/\"",
"prepublishOnly": "yarn run build",
"format:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx}'",
"format:write": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
"format:check": "prettier --check \"./src/**/*.{js,jsx,ts,tsx}\"",
"format:write": "prettier --write \"./src/**/*.{js,jsx,ts,tsx}\"",
"test": "jest"
},
"eslintConfig": {
Expand Down
10 changes: 8 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineConfig } from 'tsup';
import { sassPlugin } from 'esbuild-sass-plugin';
import inlineImage from 'esbuild-plugin-inline-image';

const env = process.env.NODE_ENV;

export default defineConfig([
{
entry: ['src/index.ts'],
Expand All @@ -14,7 +16,9 @@ export default defineConfig([
},
esbuildPlugins: [inlineImage({ limit: -1 }), sassPlugin({ type: 'style' })],
esbuildOptions(options) {
options.drop = ['console'];
if (env === 'production') {
options.drop = ['console'];
}
},
outExtension() {
return {
Expand All @@ -29,7 +33,9 @@ export default defineConfig([
platform: 'browser',
esbuildPlugins: [inlineImage({ limit: -1 }), sassPlugin({ type: 'style' })],
esbuildOptions(options) {
options.drop = ['console'];
if (env === 'production') {
options.drop = ['console'];
}
},
outExtension() {
return {
Expand Down

0 comments on commit cc8b2aa

Please sign in to comment.