From 4f9e994c5962947893e0c7faae41163a4f4fc8e7 Mon Sep 17 00:00:00 2001 From: Marek Piasecki Date: Thu, 19 Jan 2023 14:35:08 +0100 Subject: [PATCH] tweak configurations to make it a package --- bin/pro-router | 4 ++++ package.json | 4 ++++ vite.config.js | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 bin/pro-router diff --git a/bin/pro-router b/bin/pro-router new file mode 100644 index 0000000..6519eeb --- /dev/null +++ b/bin/pro-router @@ -0,0 +1,4 @@ +#!/usr/bin/env node +var path = require('path') +var fs = require('fs'); +require(path.join(path.dirname(fs.realpathSync(__filename)), '../dist/index3')); \ No newline at end of file diff --git a/package.json b/package.json index 23c66d9..ed60ac0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "pro-router-imba2", + "version": "1.0.0", "type": "module", "files": [ "dist" @@ -12,6 +13,9 @@ "require": "./dist/index.umd.cjs" } }, + "bin": { + "pro-router": "./bin/pro-router" + }, "scripts": { "dev": "vite", "start": "vite", diff --git a/vite.config.js b/vite.config.js index 3087980..dec371a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,16 +1,17 @@ import { imba } from 'vite-plugin-imba'; -import { proRouterViews } from './src/vite-plugin' import { resolve } from 'path' import { defineConfig } from 'vite'; import { name } from './package.json' export default defineConfig({ - plugins: [proRouterViews(), imba()], + plugins: [imba()], build: { lib: { name: name, fileName: "index", - entry: resolve(__dirname, 'src/main.imba'), - }, + entry: [resolve(__dirname, 'src/router_tag.imba'), + resolve(__dirname, 'src/vite-plugin.js'), + resolve(__dirname, 'bin/pro-router.imba')] + } }, }); \ No newline at end of file