This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
rollup.config.js
52 lines (50 loc) · 1.85 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Copyright (C) 2024 Puter Technologies Inc.
*
* This file is part of Phoenix Shell.
*
* Phoenix Shell is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy';
const configFile = process.env.CONFIG_FILE ?? 'config/dev.js';
await import(`./${configFile}`);
export default {
input: "src/main_puter.js",
output: {
file: "dist/bundle.js",
format: "iife"
},
plugins: [
nodeResolve(),
commonjs(),
copy({
targets: [
{
src: 'assets/index.html',
dest: 'dist',
transform: (contents, name) => {
return contents.toString().replace('__SDK_URL__', globalThis.__CONFIG__.sdk_url);
}
},
{ src: 'assets/shell.html', dest: 'dist' },
{ src: 'assets/normalize.css', dest: 'dist' },
{ src: 'assets/style.css', dest: 'dist' },
{ src: 'node_modules/xterm/css/xterm.css', dest: 'dist' },
{ src: configFile, dest: 'dist', rename: 'config.js' }
]
}),
]
}