Skip to content

Commit abd29b2

Browse files
committed
build: 👷 Optimise le build
1 parent 310d8a2 commit abd29b2

File tree

91 files changed

+120
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+120
-122
lines changed

.storybook/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import '../src/main.css'
88

99
import './theme.css'
1010

11-
import VIcon from '../src/icons.js'
11+
import {OhVueIcon as VIcon} from 'oh-vue-icons'
1212

1313
export const parameters = {
1414
actions: { argTypesRegex: "^on[A-Z].*" },

cypress/plugins/index.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
// For component testing 1/2
1313
const { startDevServer } = require('@cypress/vite-dev-server')
1414

15-
module.exports = (on, config) => {
16-
on('dev-server:start', options =>
17-
startDevServer({
18-
options,
19-
}),
20-
)
21-
22-
return config
23-
}
2415
module.exports = (on, config) => {
2516
// on('file:preprocessor', webpack({
2617
// webpackOptions: require('@vue/cli-service/webpack.config'),

package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919
".": {
2020
"require": "./dist/vue-dsfr.umd.js",
2121
"import": "./dist/vue-dsfr.mjs"
22+
},
23+
"./dist/vue-dsfr.css": {
24+
"require": "./dist/vue-dsfr.css",
25+
"import": "./dist/vue-dsfr.css"
26+
},
27+
"./dist/vue-dsfr-fonts.css": {
28+
"require": "./dist/vue-dsfr-fonts.css",
29+
"import": "./dist/vue-dsfr-fonts.css"
30+
},
31+
"./dist/vue-dsfr-fonts-essentials.css": {
32+
"require": "./dist/vue-dsfr-fonts-essentials.css",
33+
"import": "./dist/vue-dsfr-fonts-essentials.css"
2234
}
2335
},
2436
"publishConfig": {
@@ -36,7 +48,7 @@
3648
"build": "run-p build:css build:js",
3749
"postbuild": "copyfiles types/composable.d.ts dist/composable.d.ts",
3850
"build:css": "node build-css.mjs",
39-
"build:js": "cross-env NODE_ENV=production rollup --config rollup.config.js",
51+
"build:js": "cross-env NODE_ENV=production rollup -c",
4052
"demo-app": "vite",
4153
"vitest": "vitest",
4254
"coverage": "vitest run --coverage",

rollup.config.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { defineConfig } from 'rollup'
12
import vue from 'rollup-plugin-vue'
23

34
import { nodeResolve } from '@rollup/plugin-node-resolve'
@@ -23,15 +24,16 @@ const postcssPlugins = [
2324
'focus-visible-pseudo-class': false,
2425
},
2526
}),
26-
csso,
27+
csso(),
2728
]
2829

2930
const baseOutput = {
3031
globals: {
3132
vue: 'vue',
33+
'oh-vue-icons': 'OhVueIcon',
34+
'oh-vue-icons/icons': 'oh-vue-icons/icons',
35+
'oh-vue-icons/icons/ri/index.js': 'oh-vue-icons/icons/ri/index.js',
3236
'vue-router': 'vue-router',
33-
'oh-vue-icons/dist/v3/icon.es': 'VIcon',
34-
'oh-vue-icons/icons': 'icons',
3537
'focus-trap': 'focus-trap',
3638
'focus-trap-vue': 'focus-trap-vue',
3739
},
@@ -43,8 +45,8 @@ const baseConfig = {
4345
'vue',
4446
'vue-router',
4547
'oh-vue-icons',
46-
'oh-vue-icons/dist/v3/icon.es',
4748
'oh-vue-icons/icons',
49+
'oh-vue-icons/icons/ri/index.js',
4850
'focus-trap',
4951
'focus-trap-vue',
5052
],
@@ -63,7 +65,7 @@ const baseConfig = {
6365
],
6466
}
6567

66-
export default [
68+
export default defineConfig([
6769
// ESM build to be used with webpack/rollup.
6870
{
6971
...baseConfig,
@@ -114,4 +116,4 @@ export default [
114116
name: 'VueDsfr',
115117
},
116118
},
117-
]
119+
])

src/components/DsfrAccordion/DsfrAccordion.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { mount } from '@cypress/vue'
22
import DsfrAccordion from './DsfrAccordion.vue'
33
import DsfrAccordionsGroup from './DsfrAccordionsGroup.vue'
4-
import VIcon from '../../icons.js'
4+
import { OhVueIcon as VIcon } from 'oh-vue-icons'
55

66
import '../../main.css'
77

src/components/DsfrAccordion/DsfrAccordion.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { fireEvent, render } from '@testing-library/vue'
2-
import { VIcon } from '../../index.js'
2+
import { OhVueIcon as VIcon } from 'oh-vue-icons'
33
// import '@gouvfr/dsfr/dist/core/core.module.js'
44

55
import DsfrAccordion from './DsfrAccordion.vue'

src/components/DsfrAccordion/DsfrAccordion.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default defineComponent({
6464
</section>
6565
</template>
6666

67-
<style src="@gouvfr/dsfr/dist/component/accordion/accordion.main.css" />
67+
<style src="@gouvfr/dsfr/dist/component/accordion/accordion.main.min.css" />
6868

6969
<style scoped>
7070
.fr-collapse--expanded {

src/components/DsfrAlert/DsfrAlert.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '@cypress/vue'
22
import DsfrAlert from './DsfrAlert.vue'
3-
import VIcon from '../../icons.js'
3+
import { OhVueIcon as VIcon } from 'oh-vue-icons'
44

55
import '../../main.css'
66

src/components/DsfrAlert/DsfrAlert.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { VIcon, addIcons } from '../../index.js'
1+
import { OhVueIcon as VIcon, addIcons } from 'oh-vue-icons'
22
import { fireEvent, render } from '@testing-library/vue'
33

44
import DsfrAlert from './DsfrAlert.vue'

src/components/DsfrAlert/DsfrAlert.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default defineComponent({
9999
</transition>
100100
</template>
101101

102-
<style src="@gouvfr/dsfr/dist/component/alert/alert.main.css" />
102+
<style src="@gouvfr/dsfr/dist/component/alert/alert.main.min.css" />
103103

104104
<style scoped>
105105
.fr-alert,

0 commit comments

Comments
 (0)