@ui5/webcomponents-tools 0.0.0-9e104af01 → 0.0.0-a289c53b5
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 +191 -0
- package/components-package/eslint.js +34 -28
- package/components-package/nps.js +27 -16
- package/components-package/postcss.components.js +13 -13
- package/components-package/postcss.themes.js +15 -15
- package/components-package/vite.config.js +6 -5
- package/components-package/wdio.js +393 -393
- package/icons-collection/nps.js +6 -4
- package/lib/create-icons/index.js +33 -10
- package/lib/create-new-component/index.js +81 -108
- package/lib/create-new-component/jsFileContentTemplate.js +77 -0
- package/lib/create-new-component/tsFileContentTemplate.js +84 -0
- package/lib/dev-server/virtual-index-html-plugin.js +1 -2
- package/lib/esm-abs-to-rel/index.js +1 -1
- package/lib/generate-custom-elements-manifest/index.js +31 -77
- package/lib/i18n/defaults.js +9 -2
- package/lib/i18n/toJSON.js +1 -1
- package/lib/jsdoc/preprocess.js +2 -2
- package/lib/postcss-css-to-esm/index.js +40 -7
- package/lib/replace-global-core/index.js +1 -1
- package/lib/test-runner/test-runner.js +10 -2
- package/package.json +9 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,197 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [1.13.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.2...v1.13.0-rc.3) (2023-04-27)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [1.13.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.1...v1.13.0-rc.2) (2023-04-20)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
# [1.13.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.0...v1.13.0-rc.1) (2023-04-13)
|
23
|
+
|
24
|
+
|
25
|
+
### Bug Fixes
|
26
|
+
|
27
|
+
* **framework:** correct fileName in component CSS import ([#6900](https://github.com/SAP/ui5-webcomponents/issues/6900)) ([4d950c5](https://github.com/SAP/ui5-webcomponents/commit/4d950c5ea3bee0e3b629e5797693ecf41a2cdfd3))
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
# [1.13.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0...v1.13.0-rc.0) (2023-04-06)
|
34
|
+
|
35
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
# [1.12.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
|
42
|
+
|
43
|
+
|
44
|
+
### Bug Fixes
|
45
|
+
|
46
|
+
* **theming:** fix icons version display for custom themes (built via the ThemeDesigner) ([#6815](https://github.com/SAP/ui5-webcomponents/issues/6815)) ([63ff800](https://github.com/SAP/ui5-webcomponents/commit/63ff8007889a66efae074fc6b4dbcb1b7ea36713)), closes [#6758](https://github.com/SAP/ui5-webcomponents/issues/6758)
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
# [1.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
|
53
|
+
|
54
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
# [1.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23)
|
61
|
+
|
62
|
+
|
63
|
+
### Bug Fixes
|
64
|
+
|
65
|
+
* fix eslint for JS 3rd party projects ([#6725](https://github.com/SAP/ui5-webcomponents/issues/6725)) ([215a888](https://github.com/SAP/ui5-webcomponents/commit/215a888b006e46d431edd6324812b9d39249aef4))
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
# [1.12.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.0...v1.12.0-rc.1) (2023-03-16)
|
72
|
+
|
73
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
# [1.12.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0...v1.12.0-rc.0) (2023-03-09)
|
80
|
+
|
81
|
+
|
82
|
+
### Features
|
83
|
+
|
84
|
+
* enhance create-ui5-element command to create component in TS ([#6609](https://github.com/SAP/ui5-webcomponents/issues/6609)) ([d870065](https://github.com/SAP/ui5-webcomponents/commit/d8700650a4e5991862e2076cc2c93482011c4c90))
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
# [1.11.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.4...v1.11.0) (2023-03-06)
|
91
|
+
|
92
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
# [1.11.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.3...v1.11.0-rc.4) (2023-03-02)
|
99
|
+
|
100
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
# [1.11.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.2...v1.11.0-rc.3) (2023-02-23)
|
107
|
+
|
108
|
+
|
109
|
+
### Features
|
110
|
+
|
111
|
+
* **playground:** next playground with storybook ([#5831](https://github.com/SAP/ui5-webcomponents/issues/5831)) ([79274c8](https://github.com/SAP/ui5-webcomponents/commit/79274c8e442cf5854a7fe6327f25aaed04312103)), closes [#5898](https://github.com/SAP/ui5-webcomponents/issues/5898)
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
# [1.11.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.1...v1.11.0-rc.2) (2023-02-16)
|
118
|
+
|
119
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
# [1.11.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.0...v1.11.0-rc.1) (2023-02-09)
|
126
|
+
|
127
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
# [1.11.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.4-rc.0...v1.11.0-rc.0) (2023-02-02)
|
134
|
+
|
135
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
## [1.10.4-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.3...v1.10.4-rc.0) (2023-01-26)
|
142
|
+
|
143
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
## [1.10.3](https://github.com/SAP/ui5-webcomponents/compare/v1.10.2...v1.10.3) (2023-01-25)
|
150
|
+
|
151
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
## [1.10.2](https://github.com/SAP/ui5-webcomponents/compare/v1.10.1...v1.10.2) (2023-01-25)
|
158
|
+
|
159
|
+
**Note:** Version bump only for package ui5-webcomponents
|
160
|
+
|
161
|
+
## [1.10.1](https://github.com/SAP/ui5-webcomponents/compare/v0.0.0-7b49a7ff1...v1.10.1) (2023-01-24)
|
162
|
+
|
163
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
# [1.10.0](https://github.com/SAP/ui5-webcomponents/compare/v1.9.3...v1.10.0) (2023-01-20)
|
170
|
+
|
171
|
+
|
172
|
+
### Bug Fixes
|
173
|
+
|
174
|
+
* **infra:** set Content-Type header on testsuite ([#6108](https://github.com/SAP/ui5-webcomponents/issues/6108)) ([fae3f91](https://github.com/SAP/ui5-webcomponents/commit/fae3f91975ab1dad7135bea2227f61986eff403f))
|
175
|
+
|
176
|
+
|
177
|
+
### Features
|
178
|
+
|
179
|
+
* enable TS in main, fiori ([#6064](https://github.com/SAP/ui5-webcomponents/issues/6064)) ([0b56130](https://github.com/SAP/ui5-webcomponents/commit/0b561307b93b8af465dc5bee67650069ee138f7f))
|
180
|
+
* migrate illustrated-message component to TS, small refactor ([#6195](https://github.com/SAP/ui5-webcomponents/issues/6195)) ([046c779](https://github.com/SAP/ui5-webcomponents/commit/046c779f654648172619dd720c0d90342ec78fb9))
|
181
|
+
* support decorators for custom elements metadata ([#6072](https://github.com/SAP/ui5-webcomponents/issues/6072)) ([fc9ee6e](https://github.com/SAP/ui5-webcomponents/commit/fc9ee6e2af10b4315fde072a50ab37efa180c809))
|
182
|
+
* **ui5-button, ui5-date-picker, ui5-calendar:** migrate to TS ([#6173](https://github.com/SAP/ui5-webcomponents/issues/6173)) ([7232ca0](https://github.com/SAP/ui5-webcomponents/commit/7232ca08f286c5dde10080373fb62247f1acf7b7)), closes [#6080](https://github.com/SAP/ui5-webcomponents/issues/6080)
|
183
|
+
* use Typescript for the `base` package ([#5982](https://github.com/SAP/ui5-webcomponents/issues/5982)) ([bd184d8](https://github.com/SAP/ui5-webcomponents/commit/bd184d81a4218328bc7bf04baf2bc1f69a361679))
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
## [1.9.3](https://github.com/SAP/ui5-webcomponents/compare/v1.9.2...v1.9.3) (2022-12-16)
|
190
|
+
|
191
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
6
197
|
## [1.9.1](https://github.com/SAP/ui5-webcomponents/compare/v1.9.0...v1.9.1) (2022-11-10)
|
7
198
|
|
8
199
|
|
@@ -1,3 +1,36 @@
|
|
1
|
+
const fs = require("fs");
|
2
|
+
const path = require("path");
|
3
|
+
const tsMode = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Typescript Rules
|
7
|
+
*/
|
8
|
+
const overrides = tsMode ? [{
|
9
|
+
files: ["*.ts"],
|
10
|
+
parser: "@typescript-eslint/parser",
|
11
|
+
plugins: ["@typescript-eslint"],
|
12
|
+
extends: [
|
13
|
+
"plugin:@typescript-eslint/recommended",
|
14
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
15
|
+
],
|
16
|
+
parserOptions: {
|
17
|
+
"project": ["./tsconfig.json", "./packages/*/tsconfig.json"],
|
18
|
+
},
|
19
|
+
rules: {
|
20
|
+
"no-shadow": "off",
|
21
|
+
"@typescript-eslint/no-shadow": ["error"],
|
22
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
23
|
+
"@typescript-eslint/no-floating-promises": "off",
|
24
|
+
"@typescript-eslint/no-explicit-any": "off",
|
25
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
26
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
27
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
28
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
29
|
+
"@typescript-eslint/no-empty-function": "off",
|
30
|
+
"lines-between-class-members": "off",
|
31
|
+
}
|
32
|
+
}] : [];
|
33
|
+
|
1
34
|
module.exports = {
|
2
35
|
"env": {
|
3
36
|
"browser": true,
|
@@ -5,34 +38,7 @@ module.exports = {
|
|
5
38
|
},
|
6
39
|
"root": true,
|
7
40
|
"extends": "airbnb-base",
|
8
|
-
overrides
|
9
|
-
files: ["*.ts"],
|
10
|
-
parser: "@typescript-eslint/parser",
|
11
|
-
plugins: ["@typescript-eslint"],
|
12
|
-
extends: [
|
13
|
-
"plugin:@typescript-eslint/recommended",
|
14
|
-
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
15
|
-
],
|
16
|
-
parserOptions: {
|
17
|
-
"project": ["./tsconfig.json", "./packages/*/tsconfig.json"],
|
18
|
-
},
|
19
|
-
/**
|
20
|
-
* Typescript Rules
|
21
|
-
*/
|
22
|
-
rules: {
|
23
|
-
"no-shadow": "off",
|
24
|
-
"@typescript-eslint/no-shadow": ["error"],
|
25
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
26
|
-
"@typescript-eslint/no-floating-promises": "off",
|
27
|
-
"@typescript-eslint/no-explicit-any": "off",
|
28
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
29
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
30
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
31
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
32
|
-
"@typescript-eslint/no-empty-function": "off",
|
33
|
-
"lines-between-class-members": "off",
|
34
|
-
}
|
35
|
-
}],
|
41
|
+
overrides,
|
36
42
|
"parserOptions": {
|
37
43
|
"ecmaVersion": 2018,
|
38
44
|
"sourceType": "module"
|
@@ -8,14 +8,26 @@ const getScripts = (options) => {
|
|
8
8
|
|
9
9
|
// The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
|
10
10
|
const illustrationsData = options.illustrationsData || [];
|
11
|
-
illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
|
11
|
+
const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
|
12
12
|
const createIllustrationsJSImportsScript = illustrations.join(" && ");
|
13
13
|
|
14
14
|
// The script creates the "dist/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
|
15
15
|
const illustrationDestinationPaths = illustrationsData.map(illustrations => illustrations.destinationPath);
|
16
16
|
const createIllustrationsLoadersScript = options.fioriPackage ? `node ${LIB}/generate-js-imports/illustrations.js ${illustrationDestinationPaths[0]} ${illustrationDestinationPaths[1]} dist/generated/js-imports` : "";
|
17
|
-
const
|
18
|
-
const
|
17
|
+
const tsOption = options.typescript;
|
18
|
+
const tsCommand = tsOption ? "tsc" : "";
|
19
|
+
const tsWatchCommand = tsOption ? "tsc --watch" : "";
|
20
|
+
const tsCrossEnv = tsOption ? "cross-env UI5_TS=true" : "";
|
21
|
+
const copySrcGenerated = tsOption ? "" : "copy.srcGenerated";
|
22
|
+
|
23
|
+
if (tsOption) {
|
24
|
+
try {
|
25
|
+
require("typescript");
|
26
|
+
} catch(e) {
|
27
|
+
console.error(`TypeScript is not found. Try to install it by running \`npm install --save-dev typescript\` if you are using npm or by running \`yarn add --dev typescript\` if you are using yarn.`);
|
28
|
+
process.exit(e.code);
|
29
|
+
}
|
30
|
+
}
|
19
31
|
|
20
32
|
let viteConfig;
|
21
33
|
if (fs.existsSync("config/vite.config.js")) {
|
@@ -30,10 +42,7 @@ const getScripts = (options) => {
|
|
30
42
|
}
|
31
43
|
|
32
44
|
let eslintConfig;
|
33
|
-
if (fs.existsSync("
|
34
|
-
// old project setup where config file is in separate folder
|
35
|
-
eslintConfig = "--config config/.eslintrc.js";
|
36
|
-
} else if (fs.existsSync(".eslintrc.js")) {
|
45
|
+
if (fs.existsSync(".eslintrc.js") || fs.existsSync(".eslintrc.cjs")) {
|
37
46
|
// preferred way of custom configuration in root project folder
|
38
47
|
eslintConfig = "";
|
39
48
|
} else {
|
@@ -42,26 +51,26 @@ const getScripts = (options) => {
|
|
42
51
|
}
|
43
52
|
|
44
53
|
const scripts = {
|
45
|
-
clean: 'rimraf jsdoc-dist && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
54
|
+
clean: 'rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
46
55
|
lint: `eslint . ${eslintConfig}`,
|
47
|
-
lintfix: `eslint . ${eslintConfig}`,
|
56
|
+
lintfix: `eslint . ${eslintConfig} --fix`,
|
48
57
|
prepare: {
|
49
|
-
default:
|
50
|
-
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps
|
58
|
+
default: `${tsCrossEnv} nps clean prepare.all typescript generateAPI`,
|
59
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"',
|
51
60
|
styleRelated: "nps build.styles build.jsonImports build.jsImports",
|
52
61
|
},
|
53
62
|
typescript: tsCommand,
|
54
63
|
build: {
|
55
|
-
default: "nps lint
|
64
|
+
default: "nps prepare lint build.bundle",
|
56
65
|
templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
|
57
66
|
styles: {
|
58
|
-
default:
|
67
|
+
default: `nps build.styles.themes build.styles.components ${copySrcGenerated}`,
|
59
68
|
themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
|
60
69
|
components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
|
61
70
|
},
|
62
71
|
i18n: {
|
63
72
|
default: "nps build.i18n.defaultsjs build.i18n.json",
|
64
|
-
defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n
|
73
|
+
defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
|
65
74
|
json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
|
66
75
|
},
|
67
76
|
jsonImports: {
|
@@ -79,10 +88,11 @@ const getScripts = (options) => {
|
|
79
88
|
copy: {
|
80
89
|
default: "nps copy.src copy.props",
|
81
90
|
src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
|
91
|
+
srcGenerated: `node "${LIB}/copy-and-watch/index.js" --silent "src/generated/**/*.js" dist/generated/`,
|
82
92
|
props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
|
83
93
|
},
|
84
94
|
watch: {
|
85
|
-
default:
|
95
|
+
default: `${tsCrossEnv} concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.typescript" "nps watch.styles" "nps watch.i18n" "nps watch.props"`,
|
86
96
|
devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
|
87
97
|
src: 'nps "copy.src --watch --safe --skip-initial-copy"',
|
88
98
|
typescript: tsWatchCommand,
|
@@ -120,8 +130,9 @@ const getScripts = (options) => {
|
|
120
130
|
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
121
131
|
},
|
122
132
|
generateAPI: {
|
123
|
-
default: "nps generateAPI.prepare generateAPI.preprocess generateAPI.jsdoc generateAPI.cleanup",
|
133
|
+
default: "nps generateAPI.prepare generateAPI.preprocess generateAPI.jsdoc generateAPI.cleanup generateAPI.prepareManifest",
|
124
134
|
prepare: `node "${LIB}/copy-and-watch/index.js" --silent "dist/**/*.js" jsdoc-dist/`,
|
135
|
+
prepareManifest: `node "${LIB}/generate-custom-elements-manifest/index.js" dist dist`,
|
125
136
|
preprocess: `node "${preprocessJSDocScript}" jsdoc-dist/ src`,
|
126
137
|
jsdoc: `jsdoc -c "${LIB}/jsdoc/configTypescript.json"`,
|
127
138
|
cleanup: "rimraf jsdoc-dist/"
|
@@ -6,16 +6,16 @@ const fs = require("fs");
|
|
6
6
|
const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
|
7
7
|
|
8
8
|
module.exports = {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
}
|
9
|
+
plugins: [
|
10
|
+
postcssImport(),
|
11
|
+
cssnano({
|
12
|
+
preset: [
|
13
|
+
'default', {
|
14
|
+
mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
|
15
|
+
mergeRules: false, // https://github.com/cssnano/cssnano/issues/730
|
16
|
+
},
|
17
|
+
]
|
18
|
+
}),
|
19
|
+
postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName }),
|
20
|
+
]
|
21
|
+
}
|
@@ -8,19 +8,19 @@ const fs = require("fs");
|
|
8
8
|
const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
|
9
9
|
|
10
10
|
module.exports = {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
11
|
+
plugins: [
|
12
|
+
postcssImport(),
|
13
|
+
combineSelectors({
|
14
|
+
removeDuplicatedProperties: true
|
15
|
+
}),
|
16
|
+
cssnano({
|
17
|
+
preset: [
|
18
|
+
'default', {
|
19
|
+
mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
|
20
|
+
},
|
21
|
+
]
|
22
|
+
},),
|
23
|
+
postcssCSStoJSON({ toReplace: 'src', packageName }),
|
24
|
+
postcssCSStoESM({ toReplace: 'src', packageName }),
|
25
|
+
]
|
26
26
|
};
|
@@ -1,12 +1,13 @@
|
|
1
1
|
// vite.config.js
|
2
|
-
|
3
|
-
|
2
|
+
import { defineConfig } from 'vite';
|
3
|
+
import virtualIndex from '../lib/dev-server/virtual-index-html-plugin.js';
|
4
4
|
|
5
|
-
|
5
|
+
export default defineConfig(async () => {
|
6
|
+
const data = await virtualIndex();
|
6
7
|
return {
|
7
8
|
build: {
|
8
9
|
emptyOutDir: false,
|
9
10
|
},
|
10
|
-
plugins: [
|
11
|
+
plugins: [data],
|
11
12
|
}
|
12
|
-
})
|
13
|
+
})
|