@unpackjs/core 2.2.0 → 2.3.0
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/compiled/css-loader/index.js +49 -49
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +37 -37
- package/compiled/sass-loader/index.js +8 -8
- package/dist/bundler-config/cache.cjs +16 -8
- package/dist/bundler-config/cache.d.ts +2 -1
- package/dist/bundler-config/cache.d.ts.map +1 -1
- package/dist/bundler-config/cache.js +23 -15
- package/dist/bundler-config/chunkSplit.d.ts.map +1 -1
- package/dist/bundler-config/chunkSplit.js +3 -3
- package/dist/bundler-config/css.cjs +13 -15
- package/dist/bundler-config/css.js +19 -21
- package/dist/bundler-config/experimentCss.cjs +12 -11
- package/dist/bundler-config/experimentCss.js +15 -14
- package/dist/bundler-config/helpers.d.ts.map +1 -1
- package/dist/bundler-config/helpers.js +6 -6
- package/dist/bundler-config/index.cjs +40 -13
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +56 -29
- package/dist/bundler-config/jsMinify.cjs +8 -10
- package/dist/bundler-config/jsMinify.d.ts +1 -1
- package/dist/bundler-config/jsMinify.d.ts.map +1 -1
- package/dist/bundler-config/jsMinify.js +11 -13
- package/dist/bundler-config/oxlint/.oxlintrc.json +0 -1
- package/dist/bundler-config/oxlint/plugin.cjs +1 -1
- package/dist/bundler-config/oxlint/plugin.js +5 -5
- package/dist/bundler-config/progress/helpers.cjs +16 -2
- package/dist/bundler-config/progress/helpers.d.ts.map +1 -1
- package/dist/bundler-config/progress/helpers.js +18 -4
- package/dist/bundler-config/progress/rspack.cjs +1 -1
- package/dist/bundler-config/progress/rspack.js +2 -2
- package/dist/bundler-config/progress/webpack.cjs +2 -2
- package/dist/bundler-config/progress/webpack.js +5 -5
- package/dist/colors.js +3 -3
- package/dist/config.cjs +6 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -6
- package/dist/constants.cjs +16 -12
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -9
- package/dist/createUnpack.cjs +25 -23
- package/dist/createUnpack.d.ts +9 -4
- package/dist/createUnpack.d.ts.map +1 -1
- package/dist/createUnpack.js +27 -25
- package/dist/fs.cjs +10 -1
- package/dist/fs.d.ts +1 -0
- package/dist/fs.d.ts.map +1 -1
- package/dist/fs.js +13 -7
- package/dist/global.js +1 -1
- package/dist/index.cjs +63 -50
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/lightningcss/loader.js +1 -1
- package/dist/lightningcss/minimizer.cjs +7 -8
- package/dist/lightningcss/minimizer.d.ts +2 -2
- package/dist/lightningcss/minimizer.d.ts.map +1 -1
- package/dist/lightningcss/minimizer.js +8 -9
- package/dist/loadEnv.cjs +122 -0
- package/dist/loadEnv.d.ts +64 -0
- package/dist/loadEnv.d.ts.map +1 -0
- package/dist/loadEnv.js +80 -0
- package/dist/loadingAnimation.cjs +76 -0
- package/dist/loadingAnimation.d.ts +9 -0
- package/dist/loadingAnimation.d.ts.map +1 -0
- package/dist/loadingAnimation.js +44 -0
- package/dist/logger.cjs +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +5 -5
- package/dist/openBrowser.d.ts.map +1 -1
- package/dist/openBrowser.js +3 -3
- package/dist/plugin.js +1 -1
- package/dist/prebundleDeps.cjs +27 -6
- package/dist/prebundleDeps.d.ts.map +1 -1
- package/dist/prebundleDeps.js +46 -25
- package/dist/progressBar.cjs +5 -2
- package/dist/progressBar.d.ts +2 -0
- package/dist/progressBar.d.ts.map +1 -1
- package/dist/progressBar.js +6 -3
- package/dist/reporter.cjs +4 -2
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +14 -12
- package/dist/run/build.cjs +4 -4
- package/dist/run/build.d.ts +1 -1
- package/dist/run/build.d.ts.map +1 -1
- package/dist/run/build.js +5 -5
- package/dist/run/dev.cjs +21 -13
- package/dist/run/dev.d.ts +1 -1
- package/dist/run/dev.d.ts.map +1 -1
- package/dist/run/dev.js +25 -17
- package/dist/run/index.js +1 -1
- package/dist/typed-css-modules/loader.cjs +2 -2
- package/dist/typed-css-modules/loader.d.ts.map +1 -1
- package/dist/typed-css-modules/loader.js +10 -10
- package/dist/typed-css-modules/plugin.js +5 -5
- package/dist/typed-css-modules/utils.d.ts.map +1 -1
- package/dist/typed-css-modules/utils.js +1 -1
- package/dist/types/chunkSplit.js +1 -1
- package/dist/types/config.d.ts +30 -6
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +1 -1
- package/dist/types/index.cjs +15 -15
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -3
- package/dist/types/lightningcss.d.ts +2 -2
- package/dist/types/lightningcss.d.ts.map +1 -1
- package/dist/types/lightningcss.js +1 -1
- package/dist/types/logger.js +1 -1
- package/dist/types/oxc.js +1 -1
- package/dist/types/plugin.d.ts +2 -2
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/plugin.js +1 -1
- package/dist/utils.cjs +3 -12
- package/dist/utils.d.ts +0 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +14 -20
- package/dist/watchFiles.cjs +1 -1
- package/dist/watchFiles.d.ts +1 -1
- package/dist/watchFiles.d.ts.map +1 -1
- package/dist/watchFiles.js +4 -4
- package/package.json +5 -4
|
@@ -4795,19 +4795,19 @@
|
|
|
4795
4795
|
}
|
|
4796
4796
|
});
|
|
4797
4797
|
},
|
|
4798
|
-
|
|
4798
|
+
92: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4799
4799
|
"use strict";
|
|
4800
|
-
const loader = __nccwpck_require__(
|
|
4800
|
+
const loader = __nccwpck_require__(810);
|
|
4801
4801
|
module.exports = loader.default;
|
|
4802
4802
|
},
|
|
4803
|
-
|
|
4803
|
+
810: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4804
4804
|
"use strict";
|
|
4805
4805
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4806
4806
|
exports["default"] = void 0;
|
|
4807
4807
|
var _url = _interopRequireDefault(__nccwpck_require__(16));
|
|
4808
4808
|
var _path = _interopRequireDefault(__nccwpck_require__(928));
|
|
4809
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
4810
|
-
var _utils = __nccwpck_require__(
|
|
4809
|
+
var _options = _interopRequireDefault(__nccwpck_require__(815));
|
|
4810
|
+
var _utils = __nccwpck_require__(859);
|
|
4811
4811
|
function _interopRequireDefault(e) {
|
|
4812
4812
|
return e && e.__esModule ? e : { default: e };
|
|
4813
4813
|
}
|
|
@@ -4917,7 +4917,7 @@
|
|
|
4917
4917
|
}
|
|
4918
4918
|
var _default = (exports["default"] = loader);
|
|
4919
4919
|
},
|
|
4920
|
-
|
|
4920
|
+
859: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4921
4921
|
"use strict";
|
|
4922
4922
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4923
4923
|
exports.errorFactory = errorFactory;
|
|
@@ -5582,7 +5582,7 @@
|
|
|
5582
5582
|
"use strict";
|
|
5583
5583
|
module.exports = require("url");
|
|
5584
5584
|
},
|
|
5585
|
-
|
|
5585
|
+
815: (module) => {
|
|
5586
5586
|
"use strict";
|
|
5587
5587
|
module.exports = JSON.parse(
|
|
5588
5588
|
'{"title":"Sass Loader options","type":"object","properties":{"implementation":{"description":"The implementation of the sass to be used.","link":"https://github.com/webpack-contrib/sass-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]},"api":{"description":"Switch between old and modern API for `sass` (`Dart Sass`) and `Sass Embedded` implementations.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","enum":["legacy","modern","modern-compiler"]},"sassOptions":{"description":"Options for `node-sass` or `sass` (`Dart Sass`) implementation.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Sass`/`SCSS` code before the actual entry file.","link":"https://github.com/webpack-contrib/sass-loader#additionaldata","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/sass-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/sass-loader#webpackimporter","type":"boolean"},"warnRuleAsWarning":{"description":"Treats the \'@warn\' rule as a webpack warning.","link":"https://github.com/webpack-contrib/sass-loader#warnruleaswarning","type":"boolean"}},"additionalProperties":false}',
|
|
@@ -5612,6 +5612,6 @@
|
|
|
5612
5612
|
}
|
|
5613
5613
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
5614
5614
|
__nccwpck_require__.ab = __dirname + "/";
|
|
5615
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
5615
|
+
var __webpack_exports__ = __nccwpck_require__(92);
|
|
5616
5616
|
module.exports = __webpack_exports__;
|
|
5617
5617
|
})();
|
|
@@ -41,7 +41,7 @@ const external_config_cjs_namespaceObject = require("../config.cjs");
|
|
|
41
41
|
const external_fs_cjs_namespaceObject = require("../fs.cjs");
|
|
42
42
|
const external_logger_cjs_namespaceObject = require("../logger.cjs");
|
|
43
43
|
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
44
|
-
async function getBuildDependencies(root, userBuildDependencies) {
|
|
44
|
+
async function getBuildDependencies(root, userBuildDependencies, envFilePaths) {
|
|
45
45
|
const rootPackageJson = external_node_path_default().join(root, 'package.json');
|
|
46
46
|
const browserslistConfig = external_node_path_default().join(root, '.browserslistrc');
|
|
47
47
|
const tsconfigPath = external_node_path_default().join(root, 'tsconfig.json');
|
|
@@ -69,29 +69,37 @@ async function getBuildDependencies(root, userBuildDependencies) {
|
|
|
69
69
|
if (tailwindConfig) buildDependencies.tailwindcss = [
|
|
70
70
|
tailwindConfig
|
|
71
71
|
];
|
|
72
|
+
if (envFilePaths && envFilePaths.length > 0) buildDependencies.envFiles = envFilePaths;
|
|
72
73
|
return {
|
|
73
74
|
...buildDependencies,
|
|
74
|
-
|
|
75
|
+
userBuildDependencies
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
async function applyCacheConfig({ config, unpackConfig }) {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
async function applyCacheConfig({ config, unpackConfig, envFilePaths }) {
|
|
79
|
+
if (!unpackConfig.build.cache || (0, external_utils_cjs_namespaceObject.isDevServer)() && unpackConfig.dev.lazyCompilation) return config;
|
|
80
|
+
const cacheConfig = (0, external_utils_cjs_namespaceObject.isPlainObject)(unpackConfig.build.cache) ? unpackConfig.build.cache : {};
|
|
80
81
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
81
|
-
const buildDependencies = await getBuildDependencies(unpackConfig.root);
|
|
82
|
+
const buildDependencies = await getBuildDependencies(unpackConfig.root, cacheConfig.buildDependencies || [], envFilePaths);
|
|
83
|
+
let cacheDirectory = cacheConfig.cacheDirectory;
|
|
84
|
+
if (cacheDirectory) cacheDirectory = external_node_path_default().isAbsolute(cacheDirectory) ? cacheDirectory : external_node_path_default().join(unpackConfig.root, cacheDirectory);
|
|
82
85
|
external_logger_cjs_namespaceObject.logger.info('persistent cache enabled');
|
|
83
86
|
config = isRspack ? (0, external_utils_cjs_namespaceObject.mergeConfig)(config, {
|
|
84
87
|
cache: true,
|
|
85
88
|
experiments: {
|
|
86
89
|
cache: {
|
|
87
90
|
type: 'persistent',
|
|
88
|
-
buildDependencies: Object.values(buildDependencies).flat()
|
|
91
|
+
buildDependencies: Object.values(buildDependencies).flat(),
|
|
92
|
+
storage: {
|
|
93
|
+
type: 'filesystem',
|
|
94
|
+
directory: cacheDirectory
|
|
95
|
+
}
|
|
89
96
|
}
|
|
90
97
|
}
|
|
91
98
|
}) : (0, external_utils_cjs_namespaceObject.mergeConfig)(config, {
|
|
92
99
|
cache: {
|
|
93
100
|
type: 'filesystem',
|
|
94
|
-
buildDependencies
|
|
101
|
+
buildDependencies,
|
|
102
|
+
cacheDirectory
|
|
95
103
|
}
|
|
96
104
|
});
|
|
97
105
|
return config;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BundlerConfiguration, UnpackConfig } from '../types/index';
|
|
2
|
-
export declare function applyCacheConfig({ config, unpackConfig, }: {
|
|
2
|
+
export declare function applyCacheConfig({ config, unpackConfig, envFilePaths, }: {
|
|
3
3
|
config: BundlerConfiguration;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
+
envFilePaths?: string[];
|
|
5
6
|
}): Promise<BundlerConfiguration>;
|
|
6
7
|
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/bundler-config/cache.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/bundler-config/cache.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AA6CzE,wBAAsB,gBAAgB,CAAC,EACrC,MAAM,EACN,YAAY,EACZ,YAAY,GACb,EAAE;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0ChC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import
|
|
3
|
+
import node_path from "node:path";
|
|
4
4
|
import { resolveConfigPath } from "../config.js";
|
|
5
5
|
import { findExists, isFileExists } from "../fs.js";
|
|
6
6
|
import { logger } from "../logger.js";
|
|
7
|
-
import { mergeConfig } from "../utils.js";
|
|
8
|
-
async function getBuildDependencies(root, userBuildDependencies) {
|
|
9
|
-
const rootPackageJson =
|
|
10
|
-
const browserslistConfig =
|
|
11
|
-
const tsconfigPath =
|
|
7
|
+
import { isDevServer, isPlainObject, mergeConfig } from "../utils.js";
|
|
8
|
+
async function getBuildDependencies(root, userBuildDependencies, envFilePaths) {
|
|
9
|
+
const rootPackageJson = node_path.join(root, 'package.json');
|
|
10
|
+
const browserslistConfig = node_path.join(root, '.browserslistrc');
|
|
11
|
+
const tsconfigPath = node_path.join(root, 'tsconfig.json');
|
|
12
12
|
const buildDependencies = {};
|
|
13
13
|
if (await isFileExists(rootPackageJson)) buildDependencies.packageJson = [
|
|
14
14
|
rootPackageJson
|
|
@@ -28,34 +28,42 @@ async function getBuildDependencies(root, userBuildDependencies) {
|
|
|
28
28
|
'cjs',
|
|
29
29
|
'mjs'
|
|
30
30
|
];
|
|
31
|
-
const configs = tailwindExts.map((ext)=>
|
|
31
|
+
const configs = tailwindExts.map((ext)=>node_path.join(root, `tailwind.config.${ext}`));
|
|
32
32
|
const tailwindConfig = findExists(configs);
|
|
33
33
|
if (tailwindConfig) buildDependencies.tailwindcss = [
|
|
34
34
|
tailwindConfig
|
|
35
35
|
];
|
|
36
|
+
if (envFilePaths && envFilePaths.length > 0) buildDependencies.envFiles = envFilePaths;
|
|
36
37
|
return {
|
|
37
38
|
...buildDependencies,
|
|
38
|
-
|
|
39
|
+
userBuildDependencies
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
async function applyCacheConfig({ config, unpackConfig }) {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
async function applyCacheConfig({ config, unpackConfig, envFilePaths }) {
|
|
43
|
+
if (!unpackConfig.build.cache || isDevServer() && unpackConfig.dev.lazyCompilation) return config;
|
|
44
|
+
const cacheConfig = isPlainObject(unpackConfig.build.cache) ? unpackConfig.build.cache : {};
|
|
44
45
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
45
|
-
const buildDependencies = await getBuildDependencies(unpackConfig.root);
|
|
46
|
+
const buildDependencies = await getBuildDependencies(unpackConfig.root, cacheConfig.buildDependencies || [], envFilePaths);
|
|
47
|
+
let cacheDirectory = cacheConfig.cacheDirectory;
|
|
48
|
+
if (cacheDirectory) cacheDirectory = node_path.isAbsolute(cacheDirectory) ? cacheDirectory : node_path.join(unpackConfig.root, cacheDirectory);
|
|
46
49
|
logger.info('persistent cache enabled');
|
|
47
50
|
config = isRspack ? mergeConfig(config, {
|
|
48
51
|
cache: true,
|
|
49
52
|
experiments: {
|
|
50
53
|
cache: {
|
|
51
54
|
type: 'persistent',
|
|
52
|
-
buildDependencies: Object.values(buildDependencies).flat()
|
|
55
|
+
buildDependencies: Object.values(buildDependencies).flat(),
|
|
56
|
+
storage: {
|
|
57
|
+
type: 'filesystem',
|
|
58
|
+
directory: cacheDirectory
|
|
59
|
+
}
|
|
53
60
|
}
|
|
54
61
|
}
|
|
55
62
|
}) : mergeConfig(config, {
|
|
56
63
|
cache: {
|
|
57
64
|
type: 'filesystem',
|
|
58
|
-
buildDependencies
|
|
65
|
+
buildDependencies,
|
|
66
|
+
cacheDirectory
|
|
59
67
|
}
|
|
60
68
|
});
|
|
61
69
|
return config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunkSplit.d.ts","sourceRoot":"","sources":["../../src/bundler-config/chunkSplit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EAKpB,YAAY,EACb,MAAM,iBAAiB,CAAA;AA4KxB,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"chunkSplit.d.ts","sourceRoot":"","sources":["../../src/bundler-config/chunkSplit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EAKpB,YAAY,EACb,MAAM,iBAAiB,CAAA;AA4KxB,eAAO,MAAM,qBAAqB,GAAI,2BAGnC;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;CAC3B,KAAG,oBAkBH,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import
|
|
3
|
+
import node_assert from "node:assert";
|
|
4
4
|
import { NODE_MODULES_REGEX } from "../constants.js";
|
|
5
5
|
import { setValueByPath } from "../utils.js";
|
|
6
6
|
function getForceSplittingGroups(forceSplitting, strategy) {
|
|
@@ -44,7 +44,7 @@ function splitByExperience(ctx) {
|
|
|
44
44
|
}
|
|
45
45
|
function splitBySize(ctx) {
|
|
46
46
|
const { forceSplittingGroups, defaultConfig, chunkSplit } = ctx;
|
|
47
|
-
|
|
47
|
+
node_assert('split-by-size' === chunkSplit.strategy);
|
|
48
48
|
return {
|
|
49
49
|
...defaultConfig,
|
|
50
50
|
minSize: chunkSplit.minSize ?? 0,
|
|
@@ -44,9 +44,10 @@ const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
|
44
44
|
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
45
45
|
const external_helpers_cjs_namespaceObject = require("./helpers.cjs");
|
|
46
46
|
function applyCssConfig({ config, unpackConfig }) {
|
|
47
|
-
var _unpackConfig_css,
|
|
47
|
+
var _unpackConfig_css, _unpackConfig_css1, _unpackConfig_build, _unpackConfig_css2, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _unpackConfig_css3, _config_module_rules2, _config_module2;
|
|
48
48
|
const MiniCssExtractPlugin = 'rspack' === unpackConfig.bundler ? core_namespaceObject.rspack.CssExtractRspackPlugin : external_mini_css_extract_plugin_default();
|
|
49
|
-
|
|
49
|
+
const sourceMap = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sourceMap;
|
|
50
|
+
let modules = null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.modules;
|
|
50
51
|
if (!(0, external_utils_cjs_namespaceObject.isPlainObject)(modules) && false !== modules) modules = {};
|
|
51
52
|
const getAutoOption = ()=>{
|
|
52
53
|
if (false === modules) return false;
|
|
@@ -59,9 +60,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
59
60
|
return external_constants_cjs_namespaceObject.CSS_MODULES_REGEX.test(resourcePath);
|
|
60
61
|
};
|
|
61
62
|
};
|
|
62
|
-
const getCommonRules = ({ importLoaders })=>
|
|
63
|
-
var _unpackConfig_css;
|
|
64
|
-
return [
|
|
63
|
+
const getCommonRules = ({ importLoaders })=>[
|
|
65
64
|
(0, external_utils_cjs_namespaceObject.isDevServer)() ? {
|
|
66
65
|
loader: (0, external_utils_cjs_namespaceObject.getCompiledPkgPath)('style-loader')
|
|
67
66
|
} : {
|
|
@@ -86,11 +85,10 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
86
85
|
exportLocalsConvention: external_constants_cjs_namespaceObject.EXPORT_LOCALS_CONVENTION,
|
|
87
86
|
namedExport: external_constants_cjs_namespaceObject.CSS_NAMED_EXPORT
|
|
88
87
|
},
|
|
89
|
-
sourceMap
|
|
88
|
+
sourceMap
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
].filter(Boolean);
|
|
93
|
-
};
|
|
94
92
|
if (!(0, external_utils_cjs_namespaceObject.isDevServer)()) {
|
|
95
93
|
var _unpackConfig_build1;
|
|
96
94
|
config.plugins.push(new MiniCssExtractPlugin({
|
|
@@ -115,30 +113,30 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
115
113
|
options: {
|
|
116
114
|
lessOptions: (0, external_utils_cjs_namespaceObject.mergeConfig)({
|
|
117
115
|
javascriptEnabled: true
|
|
118
|
-
}, (null == (
|
|
116
|
+
}, (null == (_unpackConfig_css2 = unpackConfig.css) ? void 0 : _unpackConfig_css2.less) || {}),
|
|
119
117
|
implementation: (0, external_utils_cjs_namespaceObject.getUserDepPath)(unpackConfig.root, 'less'),
|
|
120
|
-
sourceMap
|
|
118
|
+
sourceMap
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
].filter(Boolean)
|
|
124
122
|
});
|
|
125
123
|
const getLightningcssLoader = ()=>{
|
|
126
|
-
var _unpackConfig_css
|
|
124
|
+
var _unpackConfig_css;
|
|
127
125
|
return {
|
|
128
126
|
loader: external_node_path_default().resolve(__dirname, '../lightningcss/loader.cjs'),
|
|
129
127
|
options: (0, external_utils_cjs_namespaceObject.mergeConfig)((null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.lightningcss) || {}, {
|
|
130
|
-
sourceMap
|
|
131
|
-
targets: external_constants_cjs_namespaceObject.
|
|
128
|
+
sourceMap,
|
|
129
|
+
targets: external_constants_cjs_namespaceObject.DEFAULT_LIGHTNINGCSS_TARGET
|
|
132
130
|
})
|
|
133
131
|
};
|
|
134
132
|
};
|
|
135
133
|
const getPostcssLoader = ()=>{
|
|
136
|
-
var _unpackConfig_css
|
|
134
|
+
var _unpackConfig_css;
|
|
137
135
|
return {
|
|
138
136
|
loader: (0, external_utils_cjs_namespaceObject.getCompiledPkgPath)('postcss-loader'),
|
|
139
137
|
options: {
|
|
140
138
|
postcssOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.postcss,
|
|
141
|
-
sourceMap
|
|
139
|
+
sourceMap
|
|
142
140
|
}
|
|
143
141
|
};
|
|
144
142
|
};
|
|
@@ -170,7 +168,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
170
168
|
'sass'
|
|
171
169
|
]),
|
|
172
170
|
sassOptions: null == (_unpackConfig_css3 = unpackConfig.css) ? void 0 : _unpackConfig_css3.sass,
|
|
173
|
-
sourceMap
|
|
171
|
+
sourceMap
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
]
|
|
@@ -2,17 +2,18 @@ import __rslib_shim_module__ from 'module';
|
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
3
3
|
import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
4
4
|
import { dirname as __webpack_dirname__ } from "node:path";
|
|
5
|
-
import
|
|
5
|
+
import node_path from "node:path";
|
|
6
6
|
import { rspack } from "@rspack/core";
|
|
7
|
-
import
|
|
8
|
-
import { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, CSS_NAMED_EXPORT,
|
|
7
|
+
import mini_css_extract_plugin from "mini-css-extract-plugin";
|
|
8
|
+
import { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, CSS_NAMED_EXPORT, DEFAULT_LIGHTNINGCSS_TARGET, EXPORT_LOCALS_CONVENTION, THREAD_OPTIONS } from "../constants.js";
|
|
9
9
|
import { getCompiledPkgPath, getUserDepPath, isDev, isDevServer, isFunction, isPlainObject, isRegExp, mergeConfig } from "../utils.js";
|
|
10
10
|
import { getOutputFilename } from "./helpers.js";
|
|
11
11
|
var css_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
12
12
|
function applyCssConfig({ config, unpackConfig }) {
|
|
13
|
-
var _unpackConfig_css,
|
|
14
|
-
const MiniCssExtractPlugin = 'rspack' === unpackConfig.bundler ? rspack.CssExtractRspackPlugin :
|
|
15
|
-
|
|
13
|
+
var _unpackConfig_css, _unpackConfig_css1, _unpackConfig_build, _unpackConfig_css2, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _unpackConfig_css3, _config_module_rules2, _config_module2;
|
|
14
|
+
const MiniCssExtractPlugin = 'rspack' === unpackConfig.bundler ? rspack.CssExtractRspackPlugin : mini_css_extract_plugin;
|
|
15
|
+
const sourceMap = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sourceMap;
|
|
16
|
+
let modules = null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.modules;
|
|
16
17
|
if (!isPlainObject(modules) && false !== modules) modules = {};
|
|
17
18
|
const getAutoOption = ()=>{
|
|
18
19
|
if (false === modules) return false;
|
|
@@ -25,9 +26,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
25
26
|
return CSS_MODULES_REGEX.test(resourcePath);
|
|
26
27
|
};
|
|
27
28
|
};
|
|
28
|
-
const getCommonRules = ({ importLoaders })=>
|
|
29
|
-
var _unpackConfig_css;
|
|
30
|
-
return [
|
|
29
|
+
const getCommonRules = ({ importLoaders })=>[
|
|
31
30
|
isDevServer() ? {
|
|
32
31
|
loader: getCompiledPkgPath('style-loader')
|
|
33
32
|
} : {
|
|
@@ -37,7 +36,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
37
36
|
}
|
|
38
37
|
},
|
|
39
38
|
isDev() && {
|
|
40
|
-
loader:
|
|
39
|
+
loader: node_path.resolve(css_dirname, '../typed-css-modules/loader.cjs'),
|
|
41
40
|
options: {
|
|
42
41
|
modules
|
|
43
42
|
}
|
|
@@ -52,11 +51,10 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
52
51
|
exportLocalsConvention: EXPORT_LOCALS_CONVENTION,
|
|
53
52
|
namedExport: CSS_NAMED_EXPORT
|
|
54
53
|
},
|
|
55
|
-
sourceMap
|
|
54
|
+
sourceMap
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
].filter(Boolean);
|
|
59
|
-
};
|
|
60
58
|
if (!isDevServer()) {
|
|
61
59
|
var _unpackConfig_build1;
|
|
62
60
|
config.plugins.push(new MiniCssExtractPlugin({
|
|
@@ -81,30 +79,30 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
81
79
|
options: {
|
|
82
80
|
lessOptions: mergeConfig({
|
|
83
81
|
javascriptEnabled: true
|
|
84
|
-
}, (null == (
|
|
82
|
+
}, (null == (_unpackConfig_css2 = unpackConfig.css) ? void 0 : _unpackConfig_css2.less) || {}),
|
|
85
83
|
implementation: getUserDepPath(unpackConfig.root, 'less'),
|
|
86
|
-
sourceMap
|
|
84
|
+
sourceMap
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
87
|
].filter(Boolean)
|
|
90
88
|
});
|
|
91
89
|
const getLightningcssLoader = ()=>{
|
|
92
|
-
var _unpackConfig_css
|
|
90
|
+
var _unpackConfig_css;
|
|
93
91
|
return {
|
|
94
|
-
loader:
|
|
92
|
+
loader: node_path.resolve(css_dirname, '../lightningcss/loader.cjs'),
|
|
95
93
|
options: mergeConfig((null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.lightningcss) || {}, {
|
|
96
|
-
sourceMap
|
|
97
|
-
targets:
|
|
94
|
+
sourceMap,
|
|
95
|
+
targets: DEFAULT_LIGHTNINGCSS_TARGET
|
|
98
96
|
})
|
|
99
97
|
};
|
|
100
98
|
};
|
|
101
99
|
const getPostcssLoader = ()=>{
|
|
102
|
-
var _unpackConfig_css
|
|
100
|
+
var _unpackConfig_css;
|
|
103
101
|
return {
|
|
104
102
|
loader: getCompiledPkgPath('postcss-loader'),
|
|
105
103
|
options: {
|
|
106
104
|
postcssOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.postcss,
|
|
107
|
-
sourceMap
|
|
105
|
+
sourceMap
|
|
108
106
|
}
|
|
109
107
|
};
|
|
110
108
|
};
|
|
@@ -136,7 +134,7 @@ function applyCssConfig({ config, unpackConfig }) {
|
|
|
136
134
|
'sass'
|
|
137
135
|
]),
|
|
138
136
|
sassOptions: null == (_unpackConfig_css3 = unpackConfig.css) ? void 0 : _unpackConfig_css3.sass,
|
|
139
|
-
sourceMap
|
|
137
|
+
sourceMap
|
|
140
138
|
}
|
|
141
139
|
}
|
|
142
140
|
]
|
|
@@ -42,7 +42,7 @@ const plugin_cjs_namespaceObject = require("../typed-css-modules/plugin.cjs");
|
|
|
42
42
|
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
43
43
|
const external_helpers_cjs_namespaceObject = require("./helpers.cjs");
|
|
44
44
|
function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
45
|
-
var _unpackConfig_build, _unpackConfig_css, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
45
|
+
var _unpackConfig_build, _unpackConfig_css, _unpackConfig_css1, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
46
46
|
const CSS_FILENAME = (0, external_helpers_cjs_namespaceObject.getOutputFilename)({
|
|
47
47
|
type: 'css',
|
|
48
48
|
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
@@ -53,7 +53,8 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
53
53
|
'experiments',
|
|
54
54
|
'css'
|
|
55
55
|
], true);
|
|
56
|
-
|
|
56
|
+
const sourceMap = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sourceMap;
|
|
57
|
+
let modules = null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.modules;
|
|
57
58
|
if (!(0, external_utils_cjs_namespaceObject.isPlainObject)(modules) && false !== modules) modules = {};
|
|
58
59
|
if (false !== modules && false !== modules.auto) {
|
|
59
60
|
(0, external_utils_cjs_namespaceObject.setValueByPath)(config, [
|
|
@@ -95,7 +96,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
95
96
|
};
|
|
96
97
|
};
|
|
97
98
|
const getLessLoader = ()=>{
|
|
98
|
-
var _unpackConfig_css
|
|
99
|
+
var _unpackConfig_css;
|
|
99
100
|
return {
|
|
100
101
|
loader: (0, external_utils_cjs_namespaceObject.getCompiledPkgPath)('less-loader'),
|
|
101
102
|
options: {
|
|
@@ -103,7 +104,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
103
104
|
javascriptEnabled: true
|
|
104
105
|
}, (null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.less) || {}),
|
|
105
106
|
implementation: (0, external_utils_cjs_namespaceObject.getUserDepPath)(unpackConfig.root, 'less'),
|
|
106
|
-
sourceMap
|
|
107
|
+
sourceMap
|
|
107
108
|
}
|
|
108
109
|
};
|
|
109
110
|
};
|
|
@@ -126,22 +127,22 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
126
127
|
].filter(Boolean)
|
|
127
128
|
});
|
|
128
129
|
const getLightningcssLoader = ()=>{
|
|
129
|
-
var _unpackConfig_css
|
|
130
|
+
var _unpackConfig_css;
|
|
130
131
|
return {
|
|
131
132
|
loader: external_node_path_default().resolve(__dirname, '../lightningcss/loader.cjs'),
|
|
132
133
|
options: (0, external_utils_cjs_namespaceObject.mergeConfig)((null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.lightningcss) || {}, {
|
|
133
|
-
sourceMap
|
|
134
|
-
targets: external_constants_cjs_namespaceObject.
|
|
134
|
+
sourceMap,
|
|
135
|
+
targets: external_constants_cjs_namespaceObject.DEFAULT_LIGHTNINGCSS_TARGET
|
|
135
136
|
})
|
|
136
137
|
};
|
|
137
138
|
};
|
|
138
139
|
const getPostcssLoader = ()=>{
|
|
139
|
-
var _unpackConfig_css
|
|
140
|
+
var _unpackConfig_css;
|
|
140
141
|
return {
|
|
141
142
|
loader: (0, external_utils_cjs_namespaceObject.getCompiledPkgPath)('postcss-loader'),
|
|
142
143
|
options: {
|
|
143
144
|
postcssOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.postcss,
|
|
144
|
-
sourceMap
|
|
145
|
+
sourceMap
|
|
145
146
|
}
|
|
146
147
|
};
|
|
147
148
|
};
|
|
@@ -166,7 +167,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
166
167
|
].filter(Boolean)
|
|
167
168
|
});
|
|
168
169
|
const getSassLoader = ()=>{
|
|
169
|
-
var _unpackConfig_css
|
|
170
|
+
var _unpackConfig_css;
|
|
170
171
|
return {
|
|
171
172
|
loader: (0, external_utils_cjs_namespaceObject.getCompiledPkgPath)('sass-loader'),
|
|
172
173
|
options: {
|
|
@@ -176,7 +177,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
176
177
|
'sass'
|
|
177
178
|
]),
|
|
178
179
|
sassOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sass,
|
|
179
|
-
sourceMap
|
|
180
|
+
sourceMap
|
|
180
181
|
}
|
|
181
182
|
};
|
|
182
183
|
};
|
|
@@ -2,14 +2,14 @@ import __rslib_shim_module__ from 'module';
|
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
3
3
|
import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
4
4
|
import { dirname as __webpack_dirname__ } from "node:path";
|
|
5
|
-
import
|
|
6
|
-
import { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, CSS_NAMED_EXPORT,
|
|
5
|
+
import node_path from "node:path";
|
|
6
|
+
import { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, CSS_NAMED_EXPORT, DEFAULT_LIGHTNINGCSS_TARGET, EXPORT_LOCALS_CONVENTION, THREAD_OPTIONS } from "../constants.js";
|
|
7
7
|
import { PluginTypedCssModules } from "../typed-css-modules/plugin.js";
|
|
8
8
|
import { getCompiledPkgPath, getUserDepPath, isDev, isFunction, isPlainObject, isRegExp, mergeConfig, setValueByPath } from "../utils.js";
|
|
9
9
|
import { getOutputFilename } from "./helpers.js";
|
|
10
10
|
var experimentCss_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
11
11
|
function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
12
|
-
var _unpackConfig_build, _unpackConfig_css, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
12
|
+
var _unpackConfig_build, _unpackConfig_css, _unpackConfig_css1, _config_module_rules, _config_module, _config_module_rules1, _config_module1, _config_module_rules2, _config_module2;
|
|
13
13
|
const CSS_FILENAME = getOutputFilename({
|
|
14
14
|
type: 'css',
|
|
15
15
|
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
@@ -20,7 +20,8 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
20
20
|
'experiments',
|
|
21
21
|
'css'
|
|
22
22
|
], true);
|
|
23
|
-
|
|
23
|
+
const sourceMap = null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sourceMap;
|
|
24
|
+
let modules = null == (_unpackConfig_css1 = unpackConfig.css) ? void 0 : _unpackConfig_css1.modules;
|
|
24
25
|
if (!isPlainObject(modules) && false !== modules) modules = {};
|
|
25
26
|
if (false !== modules && false !== modules.auto) {
|
|
26
27
|
setValueByPath(config, [
|
|
@@ -62,7 +63,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
65
|
const getLessLoader = ()=>{
|
|
65
|
-
var _unpackConfig_css
|
|
66
|
+
var _unpackConfig_css;
|
|
66
67
|
return {
|
|
67
68
|
loader: getCompiledPkgPath('less-loader'),
|
|
68
69
|
options: {
|
|
@@ -70,7 +71,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
70
71
|
javascriptEnabled: true
|
|
71
72
|
}, (null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.less) || {}),
|
|
72
73
|
implementation: getUserDepPath(unpackConfig.root, 'less'),
|
|
73
|
-
sourceMap
|
|
74
|
+
sourceMap
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
};
|
|
@@ -93,22 +94,22 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
93
94
|
].filter(Boolean)
|
|
94
95
|
});
|
|
95
96
|
const getLightningcssLoader = ()=>{
|
|
96
|
-
var _unpackConfig_css
|
|
97
|
+
var _unpackConfig_css;
|
|
97
98
|
return {
|
|
98
|
-
loader:
|
|
99
|
+
loader: node_path.resolve(experimentCss_dirname, '../lightningcss/loader.cjs'),
|
|
99
100
|
options: mergeConfig((null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.lightningcss) || {}, {
|
|
100
|
-
sourceMap
|
|
101
|
-
targets:
|
|
101
|
+
sourceMap,
|
|
102
|
+
targets: DEFAULT_LIGHTNINGCSS_TARGET
|
|
102
103
|
})
|
|
103
104
|
};
|
|
104
105
|
};
|
|
105
106
|
const getPostcssLoader = ()=>{
|
|
106
|
-
var _unpackConfig_css
|
|
107
|
+
var _unpackConfig_css;
|
|
107
108
|
return {
|
|
108
109
|
loader: getCompiledPkgPath('postcss-loader'),
|
|
109
110
|
options: {
|
|
110
111
|
postcssOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.postcss,
|
|
111
|
-
sourceMap
|
|
112
|
+
sourceMap
|
|
112
113
|
}
|
|
113
114
|
};
|
|
114
115
|
};
|
|
@@ -133,7 +134,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
133
134
|
].filter(Boolean)
|
|
134
135
|
});
|
|
135
136
|
const getSassLoader = ()=>{
|
|
136
|
-
var _unpackConfig_css
|
|
137
|
+
var _unpackConfig_css;
|
|
137
138
|
return {
|
|
138
139
|
loader: getCompiledPkgPath('sass-loader'),
|
|
139
140
|
options: {
|
|
@@ -143,7 +144,7 @@ function applyExperimentCssConfig({ config, unpackConfig }) {
|
|
|
143
144
|
'sass'
|
|
144
145
|
]),
|
|
145
146
|
sassOptions: null == (_unpackConfig_css = unpackConfig.css) ? void 0 : _unpackConfig_css.sass,
|
|
146
|
-
sourceMap
|
|
147
|
+
sourceMap
|
|
147
148
|
}
|
|
148
149
|
};
|
|
149
150
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/bundler-config/helpers.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBjF;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AACD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/bundler-config/helpers.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBjF;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AACD,eAAO,MAAM,iBAAiB,GAAI,gBAAgB,cAAc,WAqB/D,CAAA"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import node_fs from "node:fs";
|
|
4
|
+
import node_path from "node:path";
|
|
5
5
|
import { isDev } from "../utils.js";
|
|
6
6
|
import { glob } from "tinyglobby";
|
|
7
7
|
import { DEV_DEFAULT_FILENAME, PROD_DEFAULT_FILENAME } from "../constants.js";
|
|
8
8
|
import { logger } from "../logger.js";
|
|
9
9
|
async function getEntry(root, customEntry) {
|
|
10
10
|
let entry;
|
|
11
|
-
if (customEntry) entry =
|
|
11
|
+
if (customEntry) entry = node_path.resolve(root, customEntry);
|
|
12
12
|
else {
|
|
13
13
|
const files = await glob('(index|Index).{js,ts,jsx,tsx}', {
|
|
14
|
-
cwd:
|
|
14
|
+
cwd: node_path.join(root, 'src'),
|
|
15
15
|
absolute: true
|
|
16
16
|
});
|
|
17
17
|
entry = files[0];
|
|
18
18
|
}
|
|
19
|
-
if (!
|
|
19
|
+
if (!node_fs.existsSync(entry)) {
|
|
20
20
|
logger.error(new Error('could not find entry file'));
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|