@nx/rollup 20.0.0-canary.20240926-529ab94 → 20.0.0-canary.20241001-8fa7065
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/rollup",
|
3
|
-
"version": "20.0.0-canary.
|
3
|
+
"version": "20.0.0-canary.20241001-8fa7065",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.",
|
6
6
|
"repository": {
|
@@ -43,9 +43,8 @@
|
|
43
43
|
"rollup-plugin-postcss": "^4.0.2",
|
44
44
|
"rollup-plugin-typescript2": "^0.36.0",
|
45
45
|
"tslib": "^2.3.0",
|
46
|
-
"@nx/devkit": "20.0.0-canary.
|
47
|
-
"@nx/js": "20.0.0-canary.
|
48
|
-
"@nrwl/rollup": "20.0.0-canary.20240926-529ab94"
|
46
|
+
"@nx/devkit": "20.0.0-canary.20241001-8fa7065",
|
47
|
+
"@nx/js": "20.0.0-canary.20241001-8fa7065"
|
49
48
|
},
|
50
49
|
"publishConfig": {
|
51
50
|
"access": "public"
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configurationGenerator = configurationGenerator;
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
6
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
6
7
|
const init_1 = require("../init/init");
|
7
8
|
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
8
9
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
@@ -32,28 +33,34 @@ async function configurationGenerator(tree, options) {
|
|
32
33
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
33
34
|
}
|
34
35
|
function createRollupConfig(tree, options) {
|
36
|
+
const isUsingTsPlugin = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
|
35
37
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
36
38
|
const buildOptions = {
|
37
|
-
outputPath:
|
39
|
+
outputPath: isUsingTsPlugin
|
40
|
+
? './dist'
|
41
|
+
: (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(project.root), 'dist', project.root === '.' ? project.name : project.root),
|
38
42
|
compiler: options.compiler ?? 'babel',
|
39
43
|
main: options.main ?? './src/index.ts',
|
40
44
|
tsConfig: options.tsConfig ?? './tsconfig.lib.json',
|
41
45
|
};
|
42
|
-
tree.write((0, devkit_1.joinPathFragments)(project.root, 'rollup.config.js'), (
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
46
|
+
tree.write((0, devkit_1.joinPathFragments)(project.root, 'rollup.config.js'), `const { withNx } = require('@nx/rollup/with-nx');
|
47
|
+
|
48
|
+
module.exports = withNx(
|
49
|
+
{
|
50
|
+
main: '${buildOptions.main}',
|
51
|
+
outputPath: '${buildOptions.outputPath}',
|
52
|
+
tsConfig: '${buildOptions.tsConfig}',
|
53
|
+
compiler: '${buildOptions.compiler}',
|
54
|
+
format: ${JSON.stringify(options.format ?? ['esm'])},
|
55
|
+
assets: [{ input: '.', output: '.', glob:'*.md' }],
|
56
|
+
},
|
57
|
+
{
|
58
|
+
// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
|
59
|
+
// e.g.
|
60
|
+
// output: { sourcemap: true },
|
61
|
+
}
|
62
|
+
);
|
63
|
+
`);
|
57
64
|
}
|
58
65
|
function checkForTargetConflicts(tree, options) {
|
59
66
|
if (options.skipValidation)
|