@quilted/rollup 0.2.20 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/esm/app.mjs +4 -1
- package/build/esm/module.mjs +16 -6
- package/build/esm/server.mjs +7 -1
- package/build/esm/shared/rollup.mjs +5 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/app.d.ts +54 -7
- package/build/typescript/app.d.ts.map +1 -1
- package/build/typescript/index.d.ts +1 -1
- package/build/typescript/index.d.ts.map +1 -1
- package/build/typescript/module.d.ts +34 -3
- package/build/typescript/module.d.ts.map +1 -1
- package/build/typescript/package.d.ts +2 -2
- package/build/typescript/server.d.ts +19 -3
- package/build/typescript/server.d.ts.map +1 -1
- package/build/typescript/shared/rollup.d.ts +10 -1
- package/build/typescript/shared/rollup.d.ts.map +1 -1
- package/package.json +1 -1
- package/source/app.ts +5 -3
- package/source/index.ts +1 -1
- package/source/module.ts +60 -6
- package/source/server.ts +24 -3
- package/source/shared/rollup.ts +14 -2
- package/build/typescript/features/request-router.d.ts +0 -15
- package/build/typescript/features/request-router.d.ts.map +0 -1
- package/build/typescript/shared/package-json.d.ts +0 -6
- package/build/typescript/shared/package-json.d.ts.map +0 -1
- package/build/typescript/shared/path.d.ts +0 -2
- package/build/typescript/shared/path.d.ts.map +0 -1
- package/build/typescript/shared/server.d.ts +0 -36
- package/build/typescript/shared/server.d.ts.map +0 -1
- package/source/shared/server.ts +0 -48
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @quilted/rollup
|
|
2
2
|
|
|
3
|
+
## 0.2.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fd3760de`](https://github.com/lemonmade/quilt/commit/fd3760de3f26de96f4e6ec622416259a110dda3f) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix module entrypoint names
|
|
8
|
+
|
|
9
|
+
## 0.2.21
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`704e17f0`](https://github.com/lemonmade/quilt/commit/704e17f0336e2cde642d5fd39badf23e9c072944) Thanks [@lemonmade](https://github.com/lemonmade)! - Improve `runtime` build option
|
|
14
|
+
|
|
3
15
|
## 0.2.20
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/build/esm/app.mjs
CHANGED
|
@@ -335,7 +335,10 @@ async function quiltAppServerPlugins({
|
|
|
335
335
|
import('./features/assets.mjs'),
|
|
336
336
|
import('./features/async.mjs'),
|
|
337
337
|
import('./features/esnext.mjs'),
|
|
338
|
-
getNodePlugins({
|
|
338
|
+
getNodePlugins({
|
|
339
|
+
bundle,
|
|
340
|
+
resolve: { exportConditions: runtime.resolve?.exportConditions }
|
|
341
|
+
})
|
|
339
342
|
]);
|
|
340
343
|
const plugins = [
|
|
341
344
|
quiltAppServerInput({ root: project.root, entry, format }),
|
package/build/esm/module.mjs
CHANGED
|
@@ -9,15 +9,18 @@ async function quiltModule({
|
|
|
9
9
|
entry,
|
|
10
10
|
env,
|
|
11
11
|
assets,
|
|
12
|
-
graphql = true
|
|
12
|
+
graphql = true,
|
|
13
|
+
runtime
|
|
13
14
|
} = {}) {
|
|
14
15
|
const project = Project.load(root);
|
|
15
16
|
const mode = (typeof env === "object" ? env?.mode : env) ?? "production";
|
|
16
|
-
const outputDirectory = project.resolve(
|
|
17
|
+
const outputDirectory = project.resolve(
|
|
18
|
+
runtime?.output?.directory ?? "build/output"
|
|
19
|
+
);
|
|
17
20
|
const reportDirectory = path.join(outputDirectory, "../reports");
|
|
18
21
|
const minify = assets?.minify ?? true;
|
|
19
22
|
const hash = assets?.hash ?? "async-only";
|
|
20
|
-
const bundle = assets?.bundle ?? true;
|
|
23
|
+
const bundle = assets?.bundle ?? runtime?.output?.bundle ?? true;
|
|
21
24
|
const browserGroup = await getBrowserGroupTargetDetails(assets?.targets, {
|
|
22
25
|
root: project.root
|
|
23
26
|
});
|
|
@@ -39,7 +42,10 @@ async function quiltModule({
|
|
|
39
42
|
import('./features/node.mjs'),
|
|
40
43
|
import('./features/react.mjs'),
|
|
41
44
|
import('./features/esnext.mjs'),
|
|
42
|
-
getNodePlugins({
|
|
45
|
+
getNodePlugins({
|
|
46
|
+
bundle,
|
|
47
|
+
resolve: { exportConditions: runtime?.resolve?.exportConditions }
|
|
48
|
+
})
|
|
43
49
|
]);
|
|
44
50
|
const finalEntry = await resolveModuleEntry(entry, project);
|
|
45
51
|
const plugins = [
|
|
@@ -98,7 +104,9 @@ async function resolveModuleEntry(entry, project) {
|
|
|
98
104
|
if (entry) {
|
|
99
105
|
if (typeof entry === "string") {
|
|
100
106
|
const absolutePath = project.resolve(entry);
|
|
101
|
-
return {
|
|
107
|
+
return {
|
|
108
|
+
[normalizeEntryName(project.relative(absolutePath))]: absolutePath
|
|
109
|
+
};
|
|
102
110
|
} else {
|
|
103
111
|
return Object.fromEntries(
|
|
104
112
|
Object.entries(entry).map(([key, value]) => [
|
|
@@ -122,7 +130,9 @@ async function resolveModuleEntry(entry, project) {
|
|
|
122
130
|
return { [normalizeEntryName(project.relative(sourceFile))]: sourceFile };
|
|
123
131
|
}
|
|
124
132
|
function normalizeEntryName(name) {
|
|
125
|
-
|
|
133
|
+
const resolvedDots = name === "." ? "index" : name.startsWith("./") ? name.slice(2) : name;
|
|
134
|
+
const extname = path.extname(resolvedDots);
|
|
135
|
+
return resolvedDots.slice(0, resolvedDots.length - extname.length);
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
export { quiltModule };
|
package/build/esm/server.mjs
CHANGED
|
@@ -41,7 +41,10 @@ async function quiltServer({
|
|
|
41
41
|
import('./features/node.mjs'),
|
|
42
42
|
import('./features/react.mjs'),
|
|
43
43
|
import('./features/esnext.mjs'),
|
|
44
|
-
getNodePlugins({
|
|
44
|
+
getNodePlugins({
|
|
45
|
+
bundle,
|
|
46
|
+
resolve: { exportConditions: runtime.resolve?.exportConditions }
|
|
47
|
+
})
|
|
45
48
|
]);
|
|
46
49
|
const serverEntry = entry ? project.resolve(entry) : await sourceForServer(project);
|
|
47
50
|
const finalEntry = format === "request-router" ? MAGIC_MODULE_ENTRY : serverEntry ?? MAGIC_MODULE_ENTRY;
|
|
@@ -121,6 +124,9 @@ function nodeServerRuntime({
|
|
|
121
124
|
format: format === "commonjs" || format === "cjs" ? "cjs" : "esm"
|
|
122
125
|
}
|
|
123
126
|
},
|
|
127
|
+
resolve: {
|
|
128
|
+
exportConditions: ["node"]
|
|
129
|
+
},
|
|
124
130
|
requestRouter() {
|
|
125
131
|
return multiline`
|
|
126
132
|
import requestRouter from ${JSON.stringify(
|
|
@@ -32,7 +32,8 @@ function normalizeRollupInput(input) {
|
|
|
32
32
|
return Array.isArray(input) && input.length === 0 ? void 0 : input;
|
|
33
33
|
}
|
|
34
34
|
async function getNodePlugins({
|
|
35
|
-
bundle = {}
|
|
35
|
+
bundle = {},
|
|
36
|
+
resolve = {}
|
|
36
37
|
} = {}) {
|
|
37
38
|
const [
|
|
38
39
|
{ default: commonjs },
|
|
@@ -49,7 +50,7 @@ async function getNodePlugins({
|
|
|
49
50
|
if (bundle === true) {
|
|
50
51
|
nodeExternalsOptions = {
|
|
51
52
|
builtins: true,
|
|
52
|
-
builtinsPrefix: "
|
|
53
|
+
builtinsPrefix: "add",
|
|
53
54
|
deps: false,
|
|
54
55
|
devDeps: false,
|
|
55
56
|
peerDeps: false,
|
|
@@ -75,7 +76,7 @@ async function getNodePlugins({
|
|
|
75
76
|
} = bundle;
|
|
76
77
|
nodeExternalsOptions = {
|
|
77
78
|
builtins: !bundleBuiltins,
|
|
78
|
-
builtinsPrefix:
|
|
79
|
+
builtinsPrefix: "add",
|
|
79
80
|
deps: !bundleDependencies,
|
|
80
81
|
devDeps: !bundleDevDependencies,
|
|
81
82
|
peerDeps: !bundlePeerDependencies,
|
|
@@ -93,6 +94,7 @@ async function getNodePlugins({
|
|
|
93
94
|
exportConditions: [
|
|
94
95
|
"esnext",
|
|
95
96
|
"quilt:esnext",
|
|
97
|
+
...resolve.exportConditions ?? [],
|
|
96
98
|
"default",
|
|
97
99
|
"module",
|
|
98
100
|
"import"
|