Compare commits
No commits in common. "a008816085fb3ce99d113e9f815df4d47c7396f7" and "72ce6e66d450d5f738d8998a19591692c627b9b6" have entirely different histories.
a008816085
...
72ce6e66d4
|
@ -1,3 +1,2 @@
|
||||||
import { RollupOptions } from "rollup";
|
import { RollupOptions } from "rollup";
|
||||||
import { RollupNodeResolveOptions } from "@rollup/plugin-node-resolve";
|
export default function preset(): RollupOptions;
|
||||||
export default function preset(globalOptions: RollupOptions, resolveOptions?: RollupNodeResolveOptions, commonJsOptions?: any): RollupOptions;
|
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import { defineConfig } from "rollup";
|
import { defineConfig } from "rollup";
|
||||||
import commonjs from "@rollup/plugin-commonjs";
|
import commonjs from "@rollup/plugin-commonjs";
|
||||||
import { nodeResolve, } from "@rollup/plugin-node-resolve";
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
import { bundleNativeModulesPlugin } from "@lumeweb/rollup-plugin-bundle-native-modules";
|
import { bundleNativeModulesPlugin } from "@lumeweb/rollup-plugin-bundle-native-modules";
|
||||||
import typescript from "@rollup/plugin-typescript";
|
import typescript from "@rollup/plugin-typescript";
|
||||||
import json from "@rollup/plugin-json";
|
import json from "@rollup/plugin-json";
|
||||||
// @ts-ignore
|
export default function preset() {
|
||||||
import merger from "object-merger";
|
return defineConfig({
|
||||||
export default function preset(globalOptions, resolveOptions = {}, commonJsOptions = {}) {
|
|
||||||
return merger(globalOptions, defineConfig({
|
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
typescript(),
|
||||||
json(),
|
json(),
|
||||||
|
@ -15,9 +13,8 @@ export default function preset(globalOptions, resolveOptions = {}, commonJsOptio
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
mainFields: ["main"],
|
mainFields: ["main"],
|
||||||
exportConditions: ["node", "require", "default"],
|
exportConditions: ["node", "require", "default"],
|
||||||
...resolveOptions,
|
|
||||||
}),
|
}),
|
||||||
commonjs(commonJsOptions),
|
commonjs(),
|
||||||
],
|
],
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
"@rollup/plugin-json": "^5.0.2",
|
"@rollup/plugin-json": "^5.0.2",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
"@rollup/plugin-typescript": "^10.0.1",
|
"@rollup/plugin-typescript": "^10.0.1",
|
||||||
"object-merger": "^1.0.3",
|
|
||||||
"rollup": "^3.7.4",
|
"rollup": "^3.7.4",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "^2.4.1",
|
||||||
"typescript": "^4.9.4"
|
"typescript": "^4.9.4"
|
||||||
|
|
41
src/index.ts
41
src/index.ts
|
@ -1,34 +1,21 @@
|
||||||
import { defineConfig, RollupOptions } from "rollup";
|
import { defineConfig, RollupOptions } from "rollup";
|
||||||
import commonjs from "@rollup/plugin-commonjs";
|
import commonjs from "@rollup/plugin-commonjs";
|
||||||
import {
|
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
nodeResolve,
|
|
||||||
RollupNodeResolveOptions,
|
|
||||||
} from "@rollup/plugin-node-resolve";
|
|
||||||
import { bundleNativeModulesPlugin } from "@lumeweb/rollup-plugin-bundle-native-modules";
|
import { bundleNativeModulesPlugin } from "@lumeweb/rollup-plugin-bundle-native-modules";
|
||||||
import typescript from "@rollup/plugin-typescript";
|
import typescript from "@rollup/plugin-typescript";
|
||||||
import json from "@rollup/plugin-json";
|
import json from "@rollup/plugin-json";
|
||||||
// @ts-ignore
|
|
||||||
import merger from "object-merger";
|
|
||||||
|
|
||||||
export default function preset(
|
export default function preset(): RollupOptions {
|
||||||
globalOptions: RollupOptions,
|
return defineConfig({
|
||||||
resolveOptions: RollupNodeResolveOptions = {},
|
plugins: [
|
||||||
commonJsOptions: any = {}
|
typescript(),
|
||||||
): RollupOptions {
|
json(),
|
||||||
return merger(
|
bundleNativeModulesPlugin(),
|
||||||
globalOptions,
|
nodeResolve({
|
||||||
defineConfig({
|
mainFields: ["main"],
|
||||||
plugins: [
|
exportConditions: ["node", "require", "default"],
|
||||||
typescript(),
|
}),
|
||||||
json(),
|
commonjs(),
|
||||||
bundleNativeModulesPlugin(),
|
],
|
||||||
nodeResolve({
|
});
|
||||||
mainFields: ["main"],
|
|
||||||
exportConditions: ["node", "require", "default"],
|
|
||||||
...resolveOptions,
|
|
||||||
}),
|
|
||||||
commonjs(commonJsOptions),
|
|
||||||
],
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ __metadata:
|
||||||
"@rollup/plugin-json": ^5.0.2
|
"@rollup/plugin-json": ^5.0.2
|
||||||
"@rollup/plugin-node-resolve": ^15.0.1
|
"@rollup/plugin-node-resolve": ^15.0.1
|
||||||
"@rollup/plugin-typescript": ^10.0.1
|
"@rollup/plugin-typescript": ^10.0.1
|
||||||
object-merger: ^1.0.3
|
|
||||||
prettier: ^2.8.1
|
prettier: ^2.8.1
|
||||||
rollup: ^3.7.4
|
rollup: ^3.7.4
|
||||||
tslib: ^2.4.1
|
tslib: ^2.4.1
|
||||||
|
@ -917,13 +916,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"object-merger@npm:^1.0.3":
|
|
||||||
version: 1.0.3
|
|
||||||
resolution: "object-merger@npm:1.0.3"
|
|
||||||
checksum: cdb4c5b533b82313e2f4cc60e1a9b1f13708fb9b675fed072d1866ca8a70c1172905457accf94061f3a393542994ff58ce73d21f0e75db8cf45c51436160e72f
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"once@npm:^1.3.0":
|
"once@npm:^1.3.0":
|
||||||
version: 1.4.0
|
version: 1.4.0
|
||||||
resolution: "once@npm:1.4.0"
|
resolution: "once@npm:1.4.0"
|
||||||
|
|
Loading…
Reference in New Issue