UNPKG

zengenti-buildstartup-package

Version:

Post-build scripts to generate the startup scripts for any configured environments

51 lines (46 loc) 1.26 kB
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; import alias from '@rollup/plugin-alias'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import path from 'path'; import { fileURLToPath } from 'url'; import packagejson from './package.json' with { type: 'json' }; const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file const __dirname = path.dirname(__filename); // get the name of the directory const projectRootDir = path.resolve(__dirname); export default { input: { "zengenti-buildstartup-package": "./src/buildStartup.js" }, output: [ { dir: './lib', format: 'cjs', sourcemap: true, exports: 'named', }, ], external: [ ...Object.keys(packagejson.dependencies), ...Object.keys(packagejson.devDependencies) ], plugins: [ peerDepsExternal(), alias({ entries: [ { find: '~', replacement: path.resolve(projectRootDir, 'src'), }, { find: '-', replacement: path.resolve(projectRootDir, './'), }, ], }), resolve({ extensions: ['.js', '.jsx', '.ts', '.tsx'], }), commonjs(), ], };