PEE/build.js

35 lines
984 B
JavaScript
Raw Normal View History

2021-12-22 21:58:20 +00:00
/* eslint-disable */
const { writeFileSync, readFileSync } = require('fs');
const extheader = `// ==UserScript==
// @name PNGFileEmbed
// @namespace https://tampermonkey.net/
// @version 0.1
// @description uhh
// @author You
2022-01-01 15:33:05 +00:00
// @match https://boards.4channel.org/*/thread/*
// @match https://boards.4chan.org/*/thread/*
2021-12-22 21:58:20 +00:00
// @icon https://www.google.com/s2/favicons?domain=4channel.org
// @require https://unpkg.com/web-streams-polyfill/dist/polyfill.min.js
2021-12-22 21:58:20 +00:00
// @grant GM_xmlhttpRequest
2022-01-01 18:10:25 +00:00
// @grant GM.xmlHttpRequest
2021-12-22 21:58:20 +00:00
// @run-at document-start
// @connect 4chan.org
// @connect 4channel.org
// @connect i.4cdn.org
// ==/UserScript==
`;
(async () => {
await require('esbuild').build({
entryPoints: ['src/main.ts'],
bundle: true,
outfile: 'dist/main.js',
define: {
global: 'window'
}
});
writeFileSync('./main.user.js', extheader + readFileSync('./dist/main.js'));
})();