swico 3.0.0-beta.2 → 3.0.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swico",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -46,7 +46,9 @@
46
46
  "dependencies": {
47
47
  "@rsbuild/plugin-basic-ssl": "^1.2.2",
48
48
  "@rsbuild/plugin-eslint": "^1.3.0",
49
+ "@rsbuild/plugin-less": "^1.6.2",
49
50
  "@rsbuild/plugin-react": "^1.4.6",
51
+ "@rsbuild/plugin-sass": "^1.5.1",
50
52
  "@rsbuild/plugin-type-check": "^1.3.4",
51
53
  "@rsbuild/plugin-vue": "^1.2.7",
52
54
  "chalk": "4.1.2",
@@ -18,6 +18,7 @@ const main_config_1 = require("../main-config");
18
18
  const utils_1 = require("../utils");
19
19
  const package_json_1 = __importDefault(require("../../package.json"));
20
20
  const core_1 = require("@rsbuild/core");
21
+ const chalk_1 = __importDefault(require("chalk"));
21
22
  const isAnalyze = process.env.ANALYZE === 'true';
22
23
  function default_1() {
23
24
  return __awaiter(this, void 0, void 0, function* () {
@@ -34,12 +35,7 @@ function default_1() {
34
35
  templateType
35
36
  });
36
37
  const rsbuild = yield (0, core_1.createRsbuild)({ config: buildConfig });
37
- yield rsbuild.build();
38
- if (isAnalyze) {
39
- yield rsbuild.preview();
40
- }
41
- utils_1.toast.info('Building...');
42
- const now = Date.now();
38
+ let now;
43
39
  rsbuild.onAfterBuild(({ stats }) => {
44
40
  if (stats.hasErrors()) {
45
41
  const info = stats.toJson({ all: true });
@@ -53,5 +49,12 @@ function default_1() {
53
49
  const duration = Date.now() - now;
54
50
  utils_1.toast.success(`Build complete in ${(duration / 1000).toFixed(2)}s`);
55
51
  });
52
+ utils_1.toast.info('Building...');
53
+ now = Date.now();
54
+ yield rsbuild.build();
55
+ if (isAnalyze) {
56
+ const { urls, port } = yield rsbuild.preview();
57
+ utils_1.toast.info(`Bundle analysis is running at:${chalk_1.default.hex('#29abe0')}${urls[0]}`);
58
+ }
56
59
  });
57
60
  }
@@ -16,6 +16,8 @@ exports.default = default_1;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const main_config_1 = require("../main-config");
18
18
  const plugin_react_1 = require("@rsbuild/plugin-react");
19
+ const plugin_less_1 = require("@rsbuild/plugin-less");
20
+ const plugin_sass_1 = require("@rsbuild/plugin-sass");
19
21
  function default_1(_a) {
20
22
  return __awaiter(this, arguments, void 0, function* ({ projectPath, entryPath, env, customConfig }) {
21
23
  var _b, _c, _d, _e, _f;
@@ -93,7 +95,12 @@ function default_1(_a) {
93
95
  template: path_1.default.join(projectPath, '/src/index.ejs'),
94
96
  templateParameters: initialDefineVarsConfig
95
97
  },
96
- plugins: [(0, plugin_react_1.pluginReact)(), ...((_f = customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.plugins) !== null && _f !== void 0 ? _f : main_config_1.initConfig.plugins)]
98
+ plugins: [
99
+ (0, plugin_react_1.pluginReact)(),
100
+ (0, plugin_sass_1.pluginSass)(),
101
+ (0, plugin_less_1.pluginLess)(),
102
+ ...((_f = customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.plugins) !== null && _f !== void 0 ? _f : main_config_1.initConfig.plugins)
103
+ ]
97
104
  };
98
105
  });
99
106
  }
@@ -16,6 +16,8 @@ exports.default = default_1;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const main_config_1 = require("../main-config");
18
18
  const plugin_vue_1 = require("@rsbuild/plugin-vue");
19
+ const plugin_sass_1 = require("@rsbuild/plugin-sass");
20
+ const plugin_less_1 = require("@rsbuild/plugin-less");
19
21
  function default_1(_a) {
20
22
  return __awaiter(this, arguments, void 0, function* ({ projectPath, entryPath, env, customConfig }) {
21
23
  var _b, _c, _d, _e, _f;
@@ -93,7 +95,12 @@ function default_1(_a) {
93
95
  template: path_1.default.join(projectPath, '/src/index.ejs'),
94
96
  templateParameters: initialDefineVarsConfig
95
97
  },
96
- plugins: [(0, plugin_vue_1.pluginVue)(), ...((_f = customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.plugins) !== null && _f !== void 0 ? _f : main_config_1.initConfig.plugins)]
98
+ plugins: [
99
+ (0, plugin_vue_1.pluginVue)(),
100
+ (0, plugin_sass_1.pluginSass)(),
101
+ (0, plugin_less_1.pluginLess)(),
102
+ ...((_f = customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.plugins) !== null && _f !== void 0 ? _f : main_config_1.initConfig.plugins)
103
+ ]
97
104
  };
98
105
  });
99
106
  }