@es-pkg/compile 1.0.10 → 1.0.12

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/cjs/index.js CHANGED
@@ -55,7 +55,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
55
55
  const { remove, log, getValidPkgName, toPascalCase } = utils__namespace;
56
56
  const { config, collectInputs, shallowInputs, pkg, relativeToApp, resolveApp } = esConfig__namespace;
57
57
  const name = getValidPkgName(pkg.name);
58
- const clean = () => {
58
+ const clean = async () => {
59
59
  log(`\u6E05\u9664 ${relativeToApp(config.es)} & ${relativeToApp(config.cjs)} \u76EE\u5F55---\u5F00\u59CB`);
60
60
  const promises = [
61
61
  remove(config.publishDir, true),
@@ -63,12 +63,15 @@ const clean = () => {
63
63
  remove(config.cjs, true),
64
64
  remove(config.iife, true)
65
65
  ];
66
- return Promise.all(promises).then(() => {
67
- log(`\u6E05\u9664 ${relativeToApp(config.es)} & ${relativeToApp(config.cjs)} \u76EE\u5F55---\u7ED3\u675F`);
68
- });
66
+ await Promise.all(promises);
67
+ log(`\u6E05\u9664 ${relativeToApp(config.es)} & ${relativeToApp(config.cjs)} \u76EE\u5F55---\u7ED3\u675F`);
69
68
  };
70
69
  function getPostcss(extract) {
71
70
  return postcss__default.default({
71
+ modules: {
72
+ localsConvention: "camelCase"
73
+ // ✅ 横线转驼峰命名
74
+ },
72
75
  extensions: [".less", ".scss", ".sass"],
73
76
  use: {
74
77
  stylus: ["sass"],
@@ -123,6 +126,7 @@ async function buildDeclarations() {
123
126
  const compilerOptions = {
124
127
  ...parsedConfig.options,
125
128
  declaration: true,
129
+ noEmit: false,
126
130
  emitDeclarationOnly: true,
127
131
  outDir: config.es,
128
132
  rootDir: resolveApp("src"),
package/esm/index.js CHANGED
@@ -17,7 +17,7 @@ import ts from 'typescript';
17
17
  const { remove, log, getValidPkgName, toPascalCase } = utils;
18
18
  const { config, collectInputs, shallowInputs, pkg, relativeToApp, resolveApp } = esConfig;
19
19
  const name = getValidPkgName(pkg.name);
20
- const clean = () => {
20
+ const clean = async () => {
21
21
  log(`\u6E05\u9664 ${relativeToApp(config.es)} & ${relativeToApp(config.cjs)} \u76EE\u5F55---\u5F00\u59CB`);
22
22
  const promises = [
23
23
  remove(config.publishDir, true),
@@ -25,12 +25,15 @@ const clean = () => {
25
25
  remove(config.cjs, true),
26
26
  remove(config.iife, true)
27
27
  ];
28
- return Promise.all(promises).then(() => {
29
- log(`\u6E05\u9664 ${relativeToApp(config.es)} & ${relativeToApp(config.cjs)} \u76EE\u5F55---\u7ED3\u675F`);
30
- });
28
+ await Promise.all(promises);
29
+ log(`\u6E05\u9664 ${relativeToApp(config.es)} & ${relativeToApp(config.cjs)} \u76EE\u5F55---\u7ED3\u675F`);
31
30
  };
32
31
  function getPostcss(extract) {
33
32
  return postcss({
33
+ modules: {
34
+ localsConvention: "camelCase"
35
+ // ✅ 横线转驼峰命名
36
+ },
34
37
  extensions: [".less", ".scss", ".sass"],
35
38
  use: {
36
39
  stylus: ["sass"],
@@ -85,6 +88,7 @@ async function buildDeclarations() {
85
88
  const compilerOptions = {
86
89
  ...parsedConfig.options,
87
90
  declaration: true,
91
+ noEmit: false,
88
92
  emitDeclarationOnly: true,
89
93
  outDir: config.es,
90
94
  rootDir: resolveApp("src"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@es-pkg/compile",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "组件打包工具",
5
5
  "main": "cjs/index.js",
6
6
  "keywords": [