@revideo/vite-plugin 0.4.7-test.1023 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +22 -40
- package/lib/openInExplorer.js +39 -38
- package/lib/partials/assets.d.ts +3 -5
- package/lib/partials/assets.js +46 -49
- package/lib/partials/corsProxy.d.ts +22 -24
- package/lib/partials/corsProxy.js +151 -175
- package/lib/partials/editor.d.ts +5 -8
- package/lib/partials/editor.js +58 -65
- package/lib/partials/imageExporter.d.ts +3 -5
- package/lib/partials/imageExporter.js +42 -54
- package/lib/partials/meta.d.ts +1 -1
- package/lib/partials/meta.js +52 -61
- package/lib/partials/metrics.d.ts +1 -1
- package/lib/partials/metrics.js +10 -10
- package/lib/partials/projects.d.ts +7 -11
- package/lib/partials/projects.js +69 -73
- package/lib/partials/scenes.d.ts +1 -1
- package/lib/partials/scenes.js +23 -25
- package/lib/partials/settings.d.ts +1 -1
- package/lib/partials/settings.js +62 -67
- package/lib/partials/webgl.d.ts +7 -7
- package/lib/partials/webgl.js +79 -87
- package/lib/plugins.d.ts +76 -76
- package/lib/plugins.js +4 -4
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.d.ts +3 -3
- package/lib/utils.js +40 -47
- package/lib/versions.d.ts +4 -4
- package/lib/versions.js +23 -28
- package/package.json +4 -4
- package/lib/partials/ffmpegExporter.d.ts +0 -25
- package/lib/partials/ffmpegExporter.js +0 -132
- package/lib/partials/ffmpegExporter.js.map +0 -1
package/lib/partials/meta.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Plugin} from 'vite';
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
2
|
export declare function metaPlugin(): Plugin;
|
package/lib/partials/meta.js
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, '__esModule', {value: true});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
6
|
exports.metaPlugin = void 0;
|
|
9
|
-
const fs_1 = __importDefault(require(
|
|
10
|
-
const path_1 = __importDefault(require(
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
11
9
|
function metaPlugin() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return `\
|
|
10
|
+
const timeStamps = {};
|
|
11
|
+
let config;
|
|
12
|
+
return {
|
|
13
|
+
name: 'revideo:meta',
|
|
14
|
+
configResolved(resolvedConfig) {
|
|
15
|
+
config = resolvedConfig;
|
|
16
|
+
},
|
|
17
|
+
async transform(code, id) {
|
|
18
|
+
const [base] = id.split('?');
|
|
19
|
+
const { name, ext } = path_1.default.posix.parse(base);
|
|
20
|
+
if (ext !== '.meta') {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const sourceFile = config.command === 'build' ? false : JSON.stringify(id);
|
|
24
|
+
/* language=typescript */
|
|
25
|
+
return `\
|
|
29
26
|
import {MetaFile} from '@revideo/core';
|
|
30
27
|
let meta;
|
|
31
28
|
if (import.meta.hot) {
|
|
@@ -39,40 +36,34 @@ if (import.meta.hot) {
|
|
|
39
36
|
meta.loadData(${code});
|
|
40
37
|
export default meta;
|
|
41
38
|
`;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
modules.push(module);
|
|
72
|
-
}
|
|
73
|
-
return modules;
|
|
74
|
-
},
|
|
75
|
-
};
|
|
39
|
+
},
|
|
40
|
+
configureServer(server) {
|
|
41
|
+
server.ws.on('revideo:meta', async ({ source, data }, client) => {
|
|
42
|
+
// Ignore virtual meta files.
|
|
43
|
+
if (source.startsWith('\0')) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
timeStamps[source] = Date.now();
|
|
47
|
+
if (!process.env.DONT_WRITE_TO_META_FILES) {
|
|
48
|
+
await fs_1.default.promises.writeFile(source, JSON.stringify(data, undefined, 2), 'utf8');
|
|
49
|
+
}
|
|
50
|
+
client.send('revideo:meta-ack', { source });
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
handleHotUpdate(ctx) {
|
|
54
|
+
const now = Date.now();
|
|
55
|
+
const modules = [];
|
|
56
|
+
for (const module of ctx.modules) {
|
|
57
|
+
if (module.file !== null &&
|
|
58
|
+
timeStamps[module.file] &&
|
|
59
|
+
timeStamps[module.file] + 1000 > now) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
modules.push(module);
|
|
63
|
+
}
|
|
64
|
+
return modules;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
76
67
|
}
|
|
77
68
|
exports.metaPlugin = metaPlugin;
|
|
78
|
-
//# sourceMappingURL=meta.js.map
|
|
69
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Plugin} from 'vite';
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
2
|
export declare function metricsPlugin(): Plugin;
|
package/lib/partials/metrics.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.metricsPlugin = void 0;
|
|
4
|
-
const telemetry_1 = require(
|
|
4
|
+
const telemetry_1 = require("@revideo/telemetry");
|
|
5
5
|
function metricsPlugin() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
return {
|
|
7
|
+
name: 'revideo:metrics',
|
|
8
|
+
async configResolved() {
|
|
9
|
+
(0, telemetry_1.sendEvent)(telemetry_1.EventName.ServerStarted);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
12
|
}
|
|
13
13
|
exports.metricsPlugin = metricsPlugin;
|
|
14
|
-
//# sourceMappingURL=metrics.js.map
|
|
14
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {Plugin} from 'vite';
|
|
2
|
-
import {PluginOptions} from '../plugins';
|
|
3
|
-
import {Projects} from '../utils';
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { PluginOptions } from '../plugins';
|
|
3
|
+
import { Projects } from '../utils';
|
|
4
4
|
interface ProjectPluginConfig {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
buildForEditor?: boolean;
|
|
6
|
+
plugins: PluginOptions[];
|
|
7
|
+
projects: Projects;
|
|
8
8
|
}
|
|
9
|
-
export declare function projectsPlugin({
|
|
10
|
-
buildForEditor,
|
|
11
|
-
plugins,
|
|
12
|
-
projects,
|
|
13
|
-
}: ProjectPluginConfig): Plugin;
|
|
9
|
+
export declare function projectsPlugin({ buildForEditor, plugins, projects, }: ProjectPluginConfig): Plugin;
|
|
14
10
|
export {};
|
package/lib/partials/projects.js
CHANGED
|
@@ -1,49 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, '__esModule', {value: true});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
6
|
exports.projectsPlugin = void 0;
|
|
9
|
-
const path_1 = __importDefault(require(
|
|
10
|
-
const utils_1 = require(
|
|
11
|
-
const versions_1 = require(
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const versions_1 = require("../versions");
|
|
12
10
|
const PROJECT_QUERY_REGEX = /[?&]project\b/;
|
|
13
|
-
function projectsPlugin({buildForEditor, plugins, projects}) {
|
|
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
|
-
|
|
11
|
+
function projectsPlugin({ buildForEditor, plugins, projects, }) {
|
|
12
|
+
const versions = JSON.stringify((0, versions_1.getVersions)());
|
|
13
|
+
let config;
|
|
14
|
+
return {
|
|
15
|
+
name: 'revideo:project',
|
|
16
|
+
configResolved(resolvedConfig) {
|
|
17
|
+
config = resolvedConfig;
|
|
18
|
+
},
|
|
19
|
+
async load(id) {
|
|
20
|
+
if (!PROJECT_QUERY_REGEX.test(id)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const [base] = id.split('?');
|
|
24
|
+
const { name, dir } = path_1.default.posix.parse(base);
|
|
25
|
+
const runsInEditor = buildForEditor || config.command === 'serve';
|
|
26
|
+
const metaFile = `${name}.meta`;
|
|
27
|
+
await (0, utils_1.createMeta)(path_1.default.join(dir, metaFile));
|
|
28
|
+
const imports = [];
|
|
29
|
+
const pluginNames = [];
|
|
30
|
+
let index = 0;
|
|
31
|
+
for (const plugin of plugins) {
|
|
32
|
+
if (plugin.entryPoint) {
|
|
33
|
+
const pluginName = `plugin${index}`;
|
|
34
|
+
let options = (await plugin.runtimeConfig?.()) ?? '';
|
|
35
|
+
if (typeof options !== 'string') {
|
|
36
|
+
options = JSON.stringify(options);
|
|
37
|
+
}
|
|
38
|
+
imports.push(`import ${pluginName} from '${plugin.entryPoint}'`);
|
|
39
|
+
pluginNames.push(`${pluginName}(${options})`);
|
|
40
|
+
index++;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/* language=typescript */
|
|
44
|
+
return `\
|
|
47
45
|
${imports.join('\n')}
|
|
48
46
|
import {${runsInEditor ? 'editorBootstrap' : 'bootstrap'}} from '@revideo/core';
|
|
49
47
|
import {MetaFile} from '@revideo/core';
|
|
@@ -58,36 +56,34 @@ import {MetaFile} from '@revideo/core';
|
|
|
58
56
|
metaFile,
|
|
59
57
|
settings,
|
|
60
58
|
);`;
|
|
61
|
-
},
|
|
62
|
-
config(config) {
|
|
63
|
-
return {
|
|
64
|
-
build: {
|
|
65
|
-
target: buildForEditor ? 'esnext' : 'modules',
|
|
66
|
-
assetsDir: './',
|
|
67
|
-
rollupOptions: {
|
|
68
|
-
preserveEntrySignatures: 'strict',
|
|
69
|
-
input: Object.fromEntries(
|
|
70
|
-
projects.list.map(project => [
|
|
71
|
-
project.name,
|
|
72
|
-
project.url + '?project',
|
|
73
|
-
]),
|
|
74
|
-
),
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
server: {
|
|
78
|
-
port: config?.server?.port ?? 9000,
|
|
79
|
-
},
|
|
80
|
-
esbuild: {
|
|
81
|
-
jsx: 'automatic',
|
|
82
|
-
jsxImportSource: '@revideo/2d/lib',
|
|
83
59
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
60
|
+
config(config) {
|
|
61
|
+
return {
|
|
62
|
+
build: {
|
|
63
|
+
target: buildForEditor ? 'esnext' : 'modules',
|
|
64
|
+
assetsDir: './',
|
|
65
|
+
rollupOptions: {
|
|
66
|
+
preserveEntrySignatures: 'strict',
|
|
67
|
+
input: Object.fromEntries(projects.list.map(project => [
|
|
68
|
+
project.name,
|
|
69
|
+
project.url + '?project',
|
|
70
|
+
])),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
server: {
|
|
74
|
+
port: config?.server?.port ?? 9000,
|
|
75
|
+
},
|
|
76
|
+
esbuild: {
|
|
77
|
+
jsx: 'automatic',
|
|
78
|
+
jsxImportSource: '@revideo/2d/lib',
|
|
79
|
+
},
|
|
80
|
+
optimizeDeps: {
|
|
81
|
+
entries: projects.list.map(project => project.url),
|
|
82
|
+
exclude: ['preact', 'preact/*', '@preact/signals'],
|
|
83
|
+
},
|
|
84
|
+
};
|
|
87
85
|
},
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
};
|
|
86
|
+
};
|
|
91
87
|
}
|
|
92
88
|
exports.projectsPlugin = projectsPlugin;
|
|
93
|
-
//# sourceMappingURL=projects.js.map
|
|
89
|
+
//# sourceMappingURL=projects.js.map
|
package/lib/partials/scenes.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Plugin} from 'vite';
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
2
|
export declare function scenesPlugin(): Plugin;
|
package/lib/partials/scenes.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, '__esModule', {value: true});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
6
|
exports.scenesPlugin = void 0;
|
|
9
|
-
const path_1 = __importDefault(require(
|
|
10
|
-
const utils_1 = require(
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const utils_1 = require("../utils");
|
|
11
9
|
const SCENE_QUERY_REGEX = /[?&]scene\b/;
|
|
12
10
|
function scenesPlugin() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
return {
|
|
12
|
+
name: 'revideo:scene',
|
|
13
|
+
async load(id) {
|
|
14
|
+
if (!SCENE_QUERY_REGEX.test(id)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const [base] = id.split('?');
|
|
18
|
+
const { name, dir } = path_1.default.posix.parse(base);
|
|
19
|
+
const metaFile = `${name}.meta`;
|
|
20
|
+
await (0, utils_1.createMeta)(path_1.default.join(dir, metaFile));
|
|
21
|
+
const sceneFile = `${name}`;
|
|
22
|
+
/* language=typescript */
|
|
23
|
+
return `\
|
|
26
24
|
import {ValueDispatcher} from '@revideo/core';
|
|
27
25
|
import metaFile from './${metaFile}';
|
|
28
26
|
import description from './${sceneFile}';
|
|
@@ -42,8 +40,8 @@ if (import.meta.hot) {
|
|
|
42
40
|
}
|
|
43
41
|
export default description;
|
|
44
42
|
`;
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
},
|
|
44
|
+
};
|
|
47
45
|
}
|
|
48
46
|
exports.scenesPlugin = scenesPlugin;
|
|
49
|
-
//# sourceMappingURL=scenes.js.map
|
|
47
|
+
//# sourceMappingURL=scenes.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Plugin} from 'vite';
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
2
|
export declare function settingsPlugin(): Plugin;
|
package/lib/partials/settings.js
CHANGED
|
@@ -1,71 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, '__esModule', {value: true});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
6
|
exports.settingsPlugin = void 0;
|
|
9
|
-
const fs_1 = __importDefault(require(
|
|
10
|
-
const os_1 = __importDefault(require(
|
|
11
|
-
const path_1 = __importDefault(require(
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
12
10
|
function settingsPlugin() {
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
};
|
|
11
|
+
const settingsId = 'virtual:settings.meta';
|
|
12
|
+
const resolvedSettingsId = '\0' + settingsId;
|
|
13
|
+
const settingsPath = path_1.default.resolve(os_1.default.homedir(), '.revideo/settings.json');
|
|
14
|
+
const outputDirectory = path_1.default.dirname(settingsPath);
|
|
15
|
+
return {
|
|
16
|
+
name: 'revideo:settings',
|
|
17
|
+
resolveId(id) {
|
|
18
|
+
if (id === settingsId) {
|
|
19
|
+
return resolvedSettingsId;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
async load(id) {
|
|
23
|
+
if (id === resolvedSettingsId) {
|
|
24
|
+
let parsed = {};
|
|
25
|
+
try {
|
|
26
|
+
parsed = JSON.parse(await fs_1.default.promises.readFile(settingsPath, 'utf8'));
|
|
27
|
+
}
|
|
28
|
+
catch (_) {
|
|
29
|
+
// Ignore an invalid settings file
|
|
30
|
+
}
|
|
31
|
+
return JSON.stringify(parsed);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
configureServer(server) {
|
|
35
|
+
server.ws.on('revideo:meta', async ({ source, data }, client) => {
|
|
36
|
+
if (source !== resolvedSettingsId) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
await fs_1.default.promises.mkdir(outputDirectory, { recursive: true });
|
|
40
|
+
const newData = JSON.stringify(data, undefined, 2);
|
|
41
|
+
let oldData = '';
|
|
42
|
+
try {
|
|
43
|
+
oldData = await fs_1.default.promises.readFile(settingsPath, 'utf8');
|
|
44
|
+
}
|
|
45
|
+
catch (_) {
|
|
46
|
+
// Ignore an invalid settings file
|
|
47
|
+
}
|
|
48
|
+
if (oldData !== newData) {
|
|
49
|
+
await Promise.all([
|
|
50
|
+
fs_1.default.promises.writeFile(settingsPath, newData, 'utf8'),
|
|
51
|
+
// Invalidate the module so that the settings are up-to-date next
|
|
52
|
+
// time the browser is refreshed.
|
|
53
|
+
server.moduleGraph.getModuleByUrl(source).then(module => {
|
|
54
|
+
if (module) {
|
|
55
|
+
server.moduleGraph.invalidateModule(module);
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
client.send('revideo:meta-ack', { source });
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|
|
69
64
|
}
|
|
70
65
|
exports.settingsPlugin = settingsPlugin;
|
|
71
|
-
//# sourceMappingURL=settings.js.map
|
|
66
|
+
//# sourceMappingURL=settings.js.map
|
package/lib/partials/webgl.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {Plugin} from 'vite';
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
2
|
declare module 'source-map' {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
interface SourceNode {
|
|
4
|
+
add(value: string | SourceNode): void;
|
|
5
|
+
}
|
|
6
|
+
interface SourceMapGenerator {
|
|
7
|
+
toJSON(): any;
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
10
|
export declare function webglPlugin(): Plugin;
|