Skip to content

Commit 4c57ca4

Browse files
authored
build(sveltekit): Upgrade to Rollup 3 (#7862)
1 parent 7eaf461 commit 4c57ca4

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

packages/sveltekit/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
"@sveltejs/kit": "^1.11.0",
3636
"svelte": "^3.44.0",
3737
"typescript": "^4.9.3",
38-
"vite": "4.0.0"
38+
"vite": "4.0.0",
39+
"rollup": "^3.20.2"
3940
},
4041
"scripts": {
4142
"build": "run-p build:transpile build:types",
4243
"build:dev": "yarn build",
43-
"build:transpile": "rollup -c rollup.npm.config.js",
44+
"build:transpile": "rollup -c rollup.npm.config.js --bundleConfigAsCjs",
4445
"build:types": "tsc -p tsconfig.types.json",
4546
"build:watch": "run-p build:transpile:watch build:types:watch",
4647
"build:dev:watch": "yarn build:watch",

packages/sveltekit/rollup.npm.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ export default makeNPMConfigVariants(
55
entrypoints: ['src/index.server.ts', 'src/index.client.ts', 'src/client/index.ts', 'src/server/index.ts'],
66
packageSpecificConfig: {
77
external: ['$app/stores'],
8+
output: {
9+
dynamicImportInCjs: true,
10+
}
811
},
912
}),
1013
);

rollup/plugins/bundlePlugins.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as path from 'path';
1414
import commonjs from '@rollup/plugin-commonjs';
1515
import deepMerge from 'deepmerge';
1616
import license from 'rollup-plugin-license';
17-
import resolve from '@rollup/plugin-node-resolve';
17+
import { nodeResolve } from '@rollup/plugin-node-resolve';
1818
import replace from '@rollup/plugin-replace';
1919
import { terser } from 'rollup-plugin-terser';
2020
import typescript from '@rollup/plugin-typescript';
@@ -178,5 +178,9 @@ export function makeTSPlugin(jsVersion) {
178178

179179
// We don't pass these plugins any options which need to be calculated or changed by us, so no need to wrap them in
180180
// another factory function, as they are themselves already factory functions.
181-
export { resolve as makeNodeResolvePlugin };
181+
182+
export function makeNodeResolvePlugin() {
183+
return nodeResolve();
184+
}
185+
182186
export { commonjs as makeCommonJSPlugin };

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23620,6 +23620,13 @@ rollup@^3.10.0:
2362023620
optionalDependencies:
2362123621
fsevents "~2.3.2"
2362223622

23623+
rollup@^3.20.2:
23624+
version "3.20.2"
23625+
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.20.2.tgz#f798c600317f216de2e4ad9f4d9ab30a89b690ff"
23626+
integrity sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==
23627+
optionalDependencies:
23628+
fsevents "~2.3.2"
23629+
2362323630
rollup@^3.7.0:
2362423631
version "3.18.0"
2362523632
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.18.0.tgz#2354ba63ba66d6a09c652c3ea0dbcd9dad72bbde"

0 commit comments

Comments
 (0)