mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-23 00:39:29 +00:00
move nodejs folder to javascript
This commit is contained in:
35
javascript/rollup.config.ts
Normal file
35
javascript/rollup.config.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import typescript from "@rollup/plugin-typescript";
|
||||
import { createFilter } from "@rollup/pluginutils";
|
||||
// import pkg from './package.json' with { type: 'json' };
|
||||
|
||||
function createRawImportPlugin(include: string) {
|
||||
const rawFilter = createFilter(include);
|
||||
|
||||
return {
|
||||
name: "raw-import",
|
||||
|
||||
transform(code: string, id: string): any {
|
||||
if (rawFilter(id)) {
|
||||
return {
|
||||
code: `export default ${JSON.stringify(code)};`,
|
||||
map: { mappings: "" },
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
output: {
|
||||
// file: pkg.module,
|
||||
file: "dist/index.js",
|
||||
format: "esm",
|
||||
sourcemap: true,
|
||||
},
|
||||
watch: {
|
||||
include: "src/**",
|
||||
},
|
||||
external: ["ejs"],
|
||||
plugins: [typescript(), createRawImportPlugin("**/templates/**")],
|
||||
};
|
||||
Reference in New Issue
Block a user