@justeattakeaway/pie-components-config 0.18.1 → 0.19.0
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/README.md +4 -1
- package/package.json +1 -1
- package/vite.config.js +28 -12
package/README.md
CHANGED
|
@@ -11,8 +11,11 @@ To use the shared config, all you need to do is import and re-export it in your
|
|
|
11
11
|
|
|
12
12
|
```js
|
|
13
13
|
import viteConfig from '@justeattakeaway/pie-components-config/vite.config';
|
|
14
|
+
import getPackageVersion from '@justeattakeaway/pie-monorepo-utils/utils/get-package-version.js';
|
|
14
15
|
|
|
15
|
-
export default viteConfig
|
|
16
|
+
export default viteConfig({
|
|
17
|
+
version: getPackageVersion(__dirname),
|
|
18
|
+
});
|
|
16
19
|
```
|
|
17
20
|
|
|
18
21
|
You can also override any values by passing in an object which will be merged deeply with the default values.
|
package/package.json
CHANGED
package/vite.config.js
CHANGED
|
@@ -6,8 +6,15 @@ import { deepmerge } from 'deepmerge-ts';
|
|
|
6
6
|
|
|
7
7
|
// https://vitejs.dev/config/
|
|
8
8
|
const sharedConfig = ({
|
|
9
|
-
build = {},
|
|
9
|
+
build = {},
|
|
10
|
+
plugins = [],
|
|
11
|
+
dtsConfig = {},
|
|
12
|
+
version = 'missing',
|
|
13
|
+
...rest
|
|
10
14
|
}) => defineConfig({
|
|
15
|
+
define: {
|
|
16
|
+
__PACKAGE_VERSION__: JSON.stringify(version),
|
|
17
|
+
},
|
|
11
18
|
build: deepmerge({
|
|
12
19
|
lib: {
|
|
13
20
|
entry: {
|
|
@@ -22,7 +29,9 @@ const sharedConfig = ({
|
|
|
22
29
|
return true;
|
|
23
30
|
}
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
// Any imports from pie-webc-core/src/internals are to be included in component bundles.
|
|
33
|
+
// Any imports outside of the internals folder must be externalised.
|
|
34
|
+
if (id.startsWith('@justeattakeaway/pie-') && !id.startsWith('@justeattakeaway/pie-webc-core/src/internals')) {
|
|
26
35
|
console.info(`Excluding ${id} from the bundle`);
|
|
27
36
|
return true;
|
|
28
37
|
}
|
|
@@ -31,6 +40,7 @@ const sharedConfig = ({
|
|
|
31
40
|
},
|
|
32
41
|
},
|
|
33
42
|
}, build),
|
|
43
|
+
|
|
34
44
|
test: {
|
|
35
45
|
dir: '.',
|
|
36
46
|
environment: 'jsdom',
|
|
@@ -41,16 +51,22 @@ const sharedConfig = ({
|
|
|
41
51
|
],
|
|
42
52
|
exclude: ['**/node_modules/**'],
|
|
43
53
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
|
|
55
|
+
plugins: deepmerge(
|
|
56
|
+
[
|
|
57
|
+
dts({
|
|
58
|
+
insertTypesEntry: true,
|
|
59
|
+
outputDir: 'dist',
|
|
60
|
+
rollupTypes: true,
|
|
61
|
+
...dtsConfig,
|
|
62
|
+
}),
|
|
63
|
+
visualizer({
|
|
64
|
+
gzipSize: true,
|
|
65
|
+
brotliSize: true,
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
plugins,
|
|
69
|
+
),
|
|
54
70
|
|
|
55
71
|
...rest,
|
|
56
72
|
});
|