Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: export rollup.defineConfig at runtime #4134

Merged
merged 4 commits into from Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/browser-entry.ts
@@ -1,2 +1,2 @@
export { default as rollup } from './rollup/rollup';
export { default as rollup, defineConfig } from './rollup/rollup';
export { version as VERSION } from 'package.json';
2 changes: 1 addition & 1 deletion src/node-entry.ts
@@ -1,3 +1,3 @@
export { default as rollup } from './rollup/rollup';
export { default as rollup, defineConfig } from './rollup/rollup';
export { default as watch } from './watch/watch-proxy';
export { version as VERSION } from 'package.json';
5 changes: 5 additions & 0 deletions test/cli/samples/config-defineConfig-cjs/_config.js
@@ -0,0 +1,5 @@
module.exports = {
description: 'uses cjs config file which return config wrapped by defineConfig',
command: 'rollup --config rollup.config.js',
execute: true
};
1 change: 1 addition & 0 deletions test/cli/samples/config-defineConfig-cjs/main.js
@@ -0,0 +1 @@
module.exports = 42;
8 changes: 8 additions & 0 deletions test/cli/samples/config-defineConfig-cjs/rollup.config.js
@@ -0,0 +1,8 @@
const { defineConfig } = require("../../../../dist/rollup");

module.exports = defineConfig({
input: 'main.js',
output: {
format: 'cjs'
},
});
6 changes: 6 additions & 0 deletions test/cli/samples/config-defineConfig-mjs/_config.js
@@ -0,0 +1,6 @@
module.exports = {
description: 'uses mjs config file which return config wrapped by defineConfig',
command: 'rollup --config rollup.config.mjs',
minNodeVersion: 13,
execute: true
};
1 change: 1 addition & 0 deletions test/cli/samples/config-defineConfig-mjs/main.js
@@ -0,0 +1 @@
module.exports = 42;
8 changes: 8 additions & 0 deletions test/cli/samples/config-defineConfig-mjs/rollup.config.mjs
@@ -0,0 +1,8 @@
import { defineConfig } from "../../../../dist/es/rollup.js"

export default defineConfig({
input: 'main.js',
output: {
format: 'cjs'
},
});