Browse Source

tweak configurations to make it a package

master
Marek Piasecki 2 years ago
parent
commit
4f9e994c59
  1. 4
      bin/pro-router
  2. 4
      package.json
  3. 9
      vite.config.js

4
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'));

4
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",

9
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')]
}
},
});
Loading…
Cancel
Save