@nx/rollup 20.0.0-beta.2 → 20.0.0-beta.4
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-beta.
|
3
|
+
"version": "20.0.0-beta.4",
|
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": {
|
@@ -35,7 +35,6 @@
|
|
35
35
|
"@rollup/plugin-json": "^6.1.0",
|
36
36
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
37
37
|
"autoprefixer": "^10.4.9",
|
38
|
-
"babel-plugin-transform-async-to-promises": "^0.8.15",
|
39
38
|
"chalk": "^4.1.0",
|
40
39
|
"minimatch": "9.0.3",
|
41
40
|
"postcss": "^8.4.38",
|
@@ -44,9 +43,9 @@
|
|
44
43
|
"rollup-plugin-postcss": "^4.0.2",
|
45
44
|
"rollup-plugin-typescript2": "^0.36.0",
|
46
45
|
"tslib": "^2.3.0",
|
47
|
-
"@nx/devkit": "20.0.0-beta.
|
48
|
-
"@nx/js": "20.0.0-beta.
|
49
|
-
"@nrwl/rollup": "20.0.0-beta.
|
46
|
+
"@nx/devkit": "20.0.0-beta.4",
|
47
|
+
"@nx/js": "20.0.0-beta.4",
|
48
|
+
"@nrwl/rollup": "20.0.0-beta.4"
|
50
49
|
},
|
51
50
|
"publishConfig": {
|
52
51
|
"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)
|