@storm-software/workspace-tools 1.178.0 → 1.178.1
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 +1 -1
- package/README.md +1 -1
- package/index.js +19 -15
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/rollup/executor.js +19 -15
- package/src/executors/rollup/utils/get-options.d.ts +2 -1
package/package.json
CHANGED
|
@@ -409522,7 +409522,7 @@ function analyze() {
|
|
|
409522
409522
|
}
|
|
409523
409523
|
};
|
|
409524
409524
|
}
|
|
409525
|
-
function withRollupConfig(rawOptions, rollupConfig = {}, dependencies) {
|
|
409525
|
+
function withRollupConfig(rawOptions, rollupConfig = {}, dependencies, config) {
|
|
409526
409526
|
const finalConfig = { ...rollupConfig };
|
|
409527
409527
|
const projectNode = getProjectNode();
|
|
409528
409528
|
const projectRoot = (0, import_node_path13.join)(import_devkit2.workspaceRoot, projectNode.data.root);
|
|
@@ -409659,10 +409659,10 @@ function withRollupConfig(rawOptions, rollupConfig = {}, dependencies) {
|
|
|
409659
409659
|
tsconfig: options.tsConfig,
|
|
409660
409660
|
tsconfigOverride: {
|
|
409661
409661
|
compilerOptions: createTsCompilerOptions(
|
|
409662
|
-
projectRoot,
|
|
409663
409662
|
tsConfig,
|
|
409664
409663
|
options,
|
|
409665
|
-
dependencies
|
|
409664
|
+
dependencies,
|
|
409665
|
+
config
|
|
409666
409666
|
)
|
|
409667
409667
|
},
|
|
409668
409668
|
verbosity: 3,
|
|
@@ -409727,18 +409727,18 @@ function createInput(options) {
|
|
|
409727
409727
|
});
|
|
409728
409728
|
return input;
|
|
409729
409729
|
}
|
|
409730
|
-
function createTsCompilerOptions(
|
|
409730
|
+
function createTsCompilerOptions(parsedCommandLine, options, dependencies, config) {
|
|
409731
409731
|
const compilerOptionPaths = (0, import_buildable_libs_utils.computeCompilerOptionsPaths)(
|
|
409732
|
-
|
|
409732
|
+
parsedCommandLine,
|
|
409733
409733
|
dependencies ?? []
|
|
409734
409734
|
);
|
|
409735
409735
|
const compilerOptions = {
|
|
409736
|
-
rootDir:
|
|
409736
|
+
rootDir: config?.workspaceRoot,
|
|
409737
409737
|
allowJs: options.allowJs,
|
|
409738
409738
|
declaration: true,
|
|
409739
409739
|
paths: compilerOptionPaths
|
|
409740
409740
|
};
|
|
409741
|
-
if (
|
|
409741
|
+
if (parsedCommandLine.options.module === ts.ModuleKind.CommonJS) {
|
|
409742
409742
|
compilerOptions["module"] = "ESNext";
|
|
409743
409743
|
}
|
|
409744
409744
|
if (options.compiler === "swc") {
|
|
@@ -409849,7 +409849,11 @@ ${formatLogMessage2(options)}`, config);
|
|
|
409849
409849
|
perf: true,
|
|
409850
409850
|
treeshake: true
|
|
409851
409851
|
};
|
|
409852
|
-
const rollupOptions = await createRollupOptions(
|
|
409852
|
+
const rollupOptions = await createRollupOptions(
|
|
409853
|
+
normalizedOptions,
|
|
409854
|
+
context,
|
|
409855
|
+
config
|
|
409856
|
+
);
|
|
409853
409857
|
const outfile = resolveOutfile(context, normalizedOptions);
|
|
409854
409858
|
if (normalizedOptions.watch) {
|
|
409855
409859
|
return yield* (0, import_async_iterable.createAsyncIterable)(({ next }) => {
|
|
@@ -409902,7 +409906,7 @@ ${formatLogMessage2(options)}`, config);
|
|
|
409902
409906
|
}
|
|
409903
409907
|
}
|
|
409904
409908
|
}
|
|
409905
|
-
async function createRollupOptions(options, context) {
|
|
409909
|
+
async function createRollupOptions(options, context, config) {
|
|
409906
409910
|
const { dependencies } = (0, import_buildable_libs_utils2.calculateProjectBuildableDependencies)(
|
|
409907
409911
|
context.taskGraph,
|
|
409908
409912
|
context.projectGraph,
|
|
@@ -409912,7 +409916,7 @@ async function createRollupOptions(options, context) {
|
|
|
409912
409916
|
context.configurationName,
|
|
409913
409917
|
true
|
|
409914
409918
|
);
|
|
409915
|
-
const rollupConfig = withRollupConfig(options, {}, dependencies);
|
|
409919
|
+
const rollupConfig = withRollupConfig(options, {}, dependencies, config);
|
|
409916
409920
|
const generatePackageJsonPlugin = Array.isArray(rollupConfig.plugins) ? rollupConfig.plugins.find(
|
|
409917
409921
|
(p2) => p2?.["name"] === import_generate_package_json2.pluginName
|
|
409918
409922
|
) : null;
|
|
@@ -409921,16 +409925,16 @@ async function createRollupOptions(options, context) {
|
|
|
409921
409925
|
);
|
|
409922
409926
|
let finalConfig = rollupConfig;
|
|
409923
409927
|
for (const _config of userDefinedRollupConfigs) {
|
|
409924
|
-
const
|
|
409925
|
-
if (typeof
|
|
409926
|
-
finalConfig =
|
|
409928
|
+
const config2 = await _config;
|
|
409929
|
+
if (typeof config2 === "function") {
|
|
409930
|
+
finalConfig = config2(finalConfig, options);
|
|
409927
409931
|
} else {
|
|
409928
409932
|
finalConfig = {
|
|
409929
409933
|
...finalConfig,
|
|
409930
|
-
...
|
|
409934
|
+
...config2,
|
|
409931
409935
|
plugins: [
|
|
409932
409936
|
...Array.isArray(finalConfig.plugins) && finalConfig.plugins?.length > 0 ? finalConfig.plugins : [],
|
|
409933
|
-
...
|
|
409937
|
+
...config2.plugins?.length > 0 ? config2.plugins : []
|
|
409934
409938
|
]
|
|
409935
409939
|
};
|
|
409936
409940
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DependentBuildableProjectNode } from "@nx/js/src/utils/buildable-libs-utils";
|
|
2
|
+
import { StormConfig } from "@storm-software/config";
|
|
2
3
|
import * as rollup from "rollup";
|
|
3
4
|
import { RollupWithNxPluginOptions } from "./normalize-options";
|
|
4
|
-
export declare function withRollupConfig(rawOptions: RollupWithNxPluginOptions, rollupConfig?: rollup.RollupOptions, dependencies?: DependentBuildableProjectNode[]): rollup.RollupOptions;
|
|
5
|
+
export declare function withRollupConfig(rawOptions: RollupWithNxPluginOptions, rollupConfig?: rollup.RollupOptions, dependencies?: DependentBuildableProjectNode[], config?: StormConfig): rollup.RollupOptions;
|