@jobber/components 8.7.0 → 8.7.1
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/dist/prebuildCssEntry.d.ts +13 -0
- package/package.json +2 -2
- package/rollup.config.mjs +15 -16
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single entry point used only for the PREBUILD_CSS step (see rollup.config.mjs).
|
|
3
|
+
*
|
|
4
|
+
* Rollup traverses a single entry's import graph in a deterministic, depth-first
|
|
5
|
+
* order, which keeps the extracted styles.css ordering stable across builds.
|
|
6
|
+
* Update this file to include any new styles that should be included in the extracted stylesheet.
|
|
7
|
+
*
|
|
8
|
+
* Both the main barrel and the primitives barrel are imported here so that every
|
|
9
|
+
* component's and styled primitive's (under `src/primitives/`) CSS lands in the
|
|
10
|
+
* extracted stylesheet.
|
|
11
|
+
*/
|
|
12
|
+
import "./index";
|
|
13
|
+
import "./primitives/index";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -556,5 +556,5 @@
|
|
|
556
556
|
"> 1%",
|
|
557
557
|
"IE 10"
|
|
558
558
|
],
|
|
559
|
-
"gitHead": "
|
|
559
|
+
"gitHead": "36bbb3d447601ce2277cf1ed0265074e479ac471"
|
|
560
560
|
}
|
package/rollup.config.mjs
CHANGED
|
@@ -15,25 +15,24 @@ const createMultiInput =
|
|
|
15
15
|
typeof multiInput === "function" ? multiInput : multiInput.default;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* When PREBUILD_CSS is supplied, only
|
|
19
|
-
* This ensures postcss maintains consistent ordering of
|
|
18
|
+
* When PREBUILD_CSS is supplied, build only a single synthetic entry that
|
|
19
|
+
* imports every barrel. This ensures postcss maintains consistent ordering of
|
|
20
|
+
* styles across builds.
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* that order.
|
|
22
|
+
* Supplying multiple inputs (multiInput globs, or separate barrels) allows rollup
|
|
23
|
+
* discover css imports in a non-deterministic order, which postcss then bundles
|
|
24
|
+
* in that order, producing a styles.css that churns on every build. A single
|
|
25
|
+
* entry is traversed depth-first in a deterministic order, so the extracted
|
|
26
|
+
* styles.css is stable.
|
|
24
27
|
*
|
|
25
|
-
*
|
|
26
|
-
* primitives (under `src/primitives/`) contribute their
|
|
27
|
-
* extracted styles.css. Without
|
|
28
|
-
* bundle but not in the stylesheet, so
|
|
28
|
+
* `src/prebuildCssEntry.ts` imports both the main barrel and the primitives
|
|
29
|
+
* barrel so that styled primitives (under `src/primitives/`) contribute their
|
|
30
|
+
* CSS module hashes to the extracted styles.css. Without the primitives barrel
|
|
31
|
+
* their class hashes appear in the JS bundle but not in the stylesheet, so
|
|
32
|
+
* consumers see no styles applied.
|
|
29
33
|
*/
|
|
30
34
|
const PREBUILD_CSS = process.env.PREBUILD_CSS === "true";
|
|
31
|
-
|
|
32
|
-
// inputs share the basename `index.ts`, so the array form would collide.
|
|
33
|
-
const PREBUILD_CSS_INPUTS = {
|
|
34
|
-
index: "src/index.ts",
|
|
35
|
-
"primitives/index": "src/primitives/index.ts",
|
|
36
|
-
};
|
|
35
|
+
const PREBUILD_CSS_INPUT = "src/prebuildCssEntry.ts";
|
|
37
36
|
|
|
38
37
|
/**
|
|
39
38
|
* PostCSS plugin to remove @charset declarations.
|
|
@@ -63,7 +62,7 @@ export default {
|
|
|
63
62
|
|
|
64
63
|
warn(warning);
|
|
65
64
|
},
|
|
66
|
-
input: PREBUILD_CSS ?
|
|
65
|
+
input: PREBUILD_CSS ? PREBUILD_CSS_INPUT : `src/**/index.{ts,tsx}`,
|
|
67
66
|
plugins: [
|
|
68
67
|
nodePolyfills(),
|
|
69
68
|
nodeResolve(),
|