@quilted/rollup 0.2.20 → 0.2.21

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @quilted/rollup
2
2
 
3
+ ## 0.2.21
4
+
5
+ ### Patch Changes
6
+
7
+ - [`704e17f0`](https://github.com/lemonmade/quilt/commit/704e17f0336e2cde642d5fd39badf23e9c072944) Thanks [@lemonmade](https://github.com/lemonmade)! - Improve `runtime` build option
8
+
3
9
  ## 0.2.20
4
10
 
5
11
  ### 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({ bundle })
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 }),
@@ -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("build/output");
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({ bundle })
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 = [
@@ -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({ bundle })
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: "strip",
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: bundleBuiltins ? "strip" : "add",
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"