-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// The following is only possible from Node 18 onwards | ||
// import pkg from "./package.json" assert { type: "json" }; | ||
|
||
// Until we only support Node 18+, this should be used instead | ||
// (see https://rollupjs.org/guide/en/#importing-packagejson) | ||
import { createRequire } from 'node:module'; | ||
const require = createRequire(import.meta.url); | ||
const pkg = require('./package.json'); | ||
|
||
import typescript from "rollup-plugin-typescript2"; | ||
|
||
export default { | ||
input: "./src/index.ts", | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: "cjs", | ||
}, | ||
{ | ||
file: pkg.module, | ||
entryFileNames: "[name].es.js", | ||
format: "esm", | ||
}, | ||
{ | ||
dir: "dist", | ||
entryFileNames: "[name].mjs", | ||
format: "esm", | ||
preserveModules: true, | ||
}, | ||
{ | ||
dir: "umd", | ||
format: "umd", | ||
name: "SolidClient", | ||
}, | ||
], | ||
plugins: [ | ||
typescript({ | ||
// Use our own version of TypeScript, rather than the one bundled with the plugin: | ||
typescript: require("typescript"), | ||
tsconfigOverride: { | ||
// Exclude tests: | ||
exclude: ["**/*.test.ts"], | ||
compilerOptions: { | ||
module: "esnext", | ||
}, | ||
}, | ||
}), | ||
], | ||
external: [ | ||
"cross-fetch", | ||
"http-link-header", | ||
"@rdfjs/dataset", | ||
"n3", | ||
"jsonld", | ||
], | ||
}; |