-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
37 lines (35 loc) · 1 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import babel from "@rollup/plugin-babel";
import typescript from "@rollup/plugin-typescript";
import commonjs from '@rollup/plugin-commonjs';
import {nodeResolve} from "@rollup/plugin-node-resolve";
import json from '@rollup/plugin-json';
import pkg from "./package.json" assert {type: 'json'};
import * as path from "path";
import {fileURLToPath} from "url";
const banner = `/*!
niwango.js v${pkg.version}
(c) 2023 xpadev-net https://xpadev.net
Released under the ${pkg.license} License.
build at: ${(new Date()).getTime()}
*/`;
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
input: 'src/main.ts',
output: {
file: 'dist/bundle.js',
format: 'umd',
name: 'Niwango',
banner
},
plugins: [
json(),
typescript(),
commonjs(),
babel({
babelHelpers: "bundled",
configFile: path.resolve(__dirname, ".babelrc.js"),
}),
nodeResolve(),
]
}