Skip to content

Commit

Permalink
feat(vite): export inertia helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Jun 1, 2022
1 parent f6934ba commit 964c557
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions vite-plugin-laravel/inertia.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dist/inertia'
20 changes: 18 additions & 2 deletions vite-plugin-laravel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,24 @@
"version": "0.2.0-beta.15",
"author": "Enzo Innocenzi",
"license": "MIT",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./inertia": {
"import": "./dist/inertia.mjs",
"require": "./dist/inertia.js",
"types": "./dist/inertia.d.ts"
}
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"*.d.ts"
],
"repository": {
"type": "git",
Expand All @@ -16,7 +30,9 @@
"bugs": "https://github.com/innocenzi/laravel-vite/issues",
"scripts": {
"prepare": "npm run build",
"build": "tsup src/index.ts",
"build": "npm run build:index && npm run build:inertia",
"build:index": "tsup src/index.ts",
"build:inertia": "tsup src/inertia.ts --no-clean",
"test": "vitest"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion vite-plugin-laravel/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Options } from 'tsup'
export const tsup: Options = {
clean: true,
dts: true,
format: ['cjs'],
format: ['cjs', 'esm'],
external: ['rollup', 'vite', 'esbuild', 'tailwindcss', 'autoprefixer'],
noExternal: ['execa'],
}

0 comments on commit 964c557

Please # to comment.