@deot/dev-builder 2.2.1 → 2.2.3
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 +3 -2
- package/dist/index.cjs.js +15 -3
- package/dist/index.es.js +14 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,8 @@ interface BUILD_OPTIONS {
|
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
25
|
import { mergeConfig, defineConfig } from 'vite';
|
|
26
|
-
import
|
|
26
|
+
import type { UserConfig } from 'vite';
|
|
27
|
+
import configShared from './node_modules/@deot/dev-builder/shared.config'; // 这样调用时才会被编译
|
|
27
28
|
|
|
28
29
|
export default mergeConfig(
|
|
29
30
|
configShared,
|
|
@@ -33,7 +34,7 @@ export default mergeConfig(
|
|
|
33
34
|
vue(),
|
|
34
35
|
react()
|
|
35
36
|
]
|
|
36
|
-
})
|
|
37
|
+
}) as UserConfig
|
|
37
38
|
);
|
|
38
39
|
```
|
|
39
40
|
取`build.config.ts`, 是为了方便从`build`转其他测试工具时,可以不改变文件名
|
package/dist/index.cjs.js
CHANGED
|
@@ -37,6 +37,7 @@ function _interopNamespaceDefault(e) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
40
|
+
const sass__namespace = /*#__PURE__*/_interopNamespaceDefault(sass);
|
|
40
41
|
|
|
41
42
|
const dirname$1 = path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
42
43
|
const run$3 = async (options) => {
|
|
@@ -119,7 +120,7 @@ const run$2 = async (options) => {
|
|
|
119
120
|
(preProcess, file) => {
|
|
120
121
|
preProcess = preProcess.then(() => {
|
|
121
122
|
let filepath = path__namespace.resolve(srcDir, file);
|
|
122
|
-
const data =
|
|
123
|
+
const data = sass__namespace.compile(filepath, { style: "compressed" });
|
|
123
124
|
return postcss().use(atImport()).use(atUrl()).use(flexBugs()).use(cssnano()).use(autoprefixer({ remove: false })).process(data.css, { from: filepath });
|
|
124
125
|
}).then((source) => {
|
|
125
126
|
let output = path__namespace.resolve(packageDir, `./dist/${file.replace(/\.scss$/g, ".css")}`);
|
|
@@ -192,9 +193,20 @@ const run$1 = async (options) => {
|
|
|
192
193
|
{
|
|
193
194
|
localBuild: true,
|
|
194
195
|
showVerboseMessages: false,
|
|
195
|
-
|
|
196
|
+
/**
|
|
197
|
+
* 去掉部分提示提示
|
|
198
|
+
* 也可设置skipLibCheck=true去掉,这个目前在puppeteer上有提示,设置了target: 'esnext'仍然有,这里先不做排查
|
|
199
|
+
* 1. (TS18028) Private identifiers are only available when targeting ECMAScript 2015 and higher
|
|
200
|
+
*
|
|
201
|
+
* 版本提示:
|
|
202
|
+
* 2. console-compiler-version-notice
|
|
203
|
+
* *** The target project appears to use TypeScript 5.1.6 which is newer
|
|
204
|
+
* than the bundled compiler engine; consider upgrading API Extractor.
|
|
205
|
+
* 3. console-preamble
|
|
206
|
+
* Analysis will use the bundled TypeScript version 5.0.4
|
|
207
|
+
*/
|
|
196
208
|
messageCallback: (message) => {
|
|
197
|
-
if (message.messageId === "console-compiler-version-notice" || message.messageId === "console-preamble") {
|
|
209
|
+
if (message.messageId === "console-compiler-version-notice" || message.messageId === "console-preamble" || message.messageId === "TS18028") {
|
|
198
210
|
message.handled = true;
|
|
199
211
|
}
|
|
200
212
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -6,7 +6,7 @@ import chalk from 'chalk';
|
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import { build as build$1 } from 'vite';
|
|
9
|
-
import sass from 'sass';
|
|
9
|
+
import * as sass from 'sass';
|
|
10
10
|
import postcss from 'postcss';
|
|
11
11
|
import atImport from 'postcss-import';
|
|
12
12
|
import atUrl from 'postcss-url';
|
|
@@ -169,9 +169,20 @@ const run$1 = async (options) => {
|
|
|
169
169
|
{
|
|
170
170
|
localBuild: true,
|
|
171
171
|
showVerboseMessages: false,
|
|
172
|
-
|
|
172
|
+
/**
|
|
173
|
+
* 去掉部分提示提示
|
|
174
|
+
* 也可设置skipLibCheck=true去掉,这个目前在puppeteer上有提示,设置了target: 'esnext'仍然有,这里先不做排查
|
|
175
|
+
* 1. (TS18028) Private identifiers are only available when targeting ECMAScript 2015 and higher
|
|
176
|
+
*
|
|
177
|
+
* 版本提示:
|
|
178
|
+
* 2. console-compiler-version-notice
|
|
179
|
+
* *** The target project appears to use TypeScript 5.1.6 which is newer
|
|
180
|
+
* than the bundled compiler engine; consider upgrading API Extractor.
|
|
181
|
+
* 3. console-preamble
|
|
182
|
+
* Analysis will use the bundled TypeScript version 5.0.4
|
|
183
|
+
*/
|
|
173
184
|
messageCallback: (message) => {
|
|
174
|
-
if (message.messageId === "console-compiler-version-notice" || message.messageId === "console-preamble") {
|
|
185
|
+
if (message.messageId === "console-compiler-version-notice" || message.messageId === "console-preamble" || message.messageId === "TS18028") {
|
|
175
186
|
message.handled = true;
|
|
176
187
|
}
|
|
177
188
|
}
|