forked from NSRingo/WeatherKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.dev.config.mjs
More file actions
45 lines (44 loc) · 1.7 KB
/
Copy pathrollup.dev.config.mjs
File metadata and controls
45 lines (44 loc) · 1.7 KB
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
38
39
40
41
42
43
44
45
import path from "node:path";
import alias from "@rollup/plugin-alias";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import pkg from "./package.json" with { type: "json" };
export default [
{
input: "./src/request.dev.js",
output: {
file: "./dist/request.bundle.js",
format: "es",
banner: chunk => `console.log('Date: ${new Date().toLocaleString("zh-CN", { timeZone: "PRC" })}');\nconsole.log('Version: ${pkg.version}');\nconsole.log('${chunk.fileName}');\nconsole.log('${pkg.displayName} β');\n/* ${pkg.homepage} */`,
},
plugins: [
alias({
entries: [
{
find: "@nsringo/weatherkit",
replacement: path.resolve(import.meta.dirname, "node_modules/@nsringo/weatherkit/dist/index.js"),
},
],
}),
nodeResolve(),
],
},
{
input: "./src/response.dev.js",
output: {
file: "./dist/response.bundle.js",
format: "es",
banner: chunk => `console.log('Date: ${new Date().toLocaleString("zh-CN", { timeZone: "PRC" })}');\nconsole.log('Version: ${pkg.version}');\nconsole.log('${chunk.fileName}');\nconsole.log('${pkg.displayName} β');\n/* ${pkg.homepage} */`,
},
plugins: [
alias({
entries: [
{
find: "@nsringo/weatherkit",
replacement: path.resolve(import.meta.dirname, "node_modules/@nsringo/weatherkit/dist/index.js"),
},
],
}),
nodeResolve(),
],
},
];