-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Distribute CommonJS for projects that cannot use ESM
Signed-off-by: Kenny Elshoff <[email protected]>
- Loading branch information
1 parent
865c3ed
commit fac8e83
Showing
10 changed files
with
109 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,50 @@ | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import typescript from 'rollup-plugin-typescript'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import json from '@rollup/plugin-json'; | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import replace from '@rollup/plugin-replace'; | ||
import multi from 'rollup-plugin-multi-input'; | ||
import {version} from './package.json'; | ||
|
||
export default [{ | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
file: 'dist/bundles/umd/base.js', | ||
format: 'umd', | ||
name:'CloudinaryBaseSDK' | ||
} | ||
], | ||
plugins: [ | ||
json(), | ||
resolve(), | ||
replace({ | ||
'PACKAGE_VERSION_INJECTED_DURING_BUILD': version | ||
}), | ||
typescript({ target: "es5"}), | ||
commonjs() | ||
] | ||
}]; | ||
export default [ | ||
{ | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
file: 'dist/bundles/umd/base.js', | ||
format: 'umd', | ||
name: 'CloudinaryBaseSDK', | ||
}, | ||
], | ||
plugins: [ | ||
json(), | ||
resolve(), | ||
replace({ | ||
'PACKAGE_VERSION_INJECTED_DURING_BUILD': version, | ||
}), | ||
typescript({ target: 'es5' }), | ||
commonjs(), | ||
], | ||
}, | ||
{ | ||
input: 'src/**/*.ts', | ||
output: { | ||
format: 'cjs', | ||
dir: 'dist', | ||
entryFileNames: '[name].cjs', | ||
chunkFileNames: '[name]-[hash].cjs', | ||
exports: 'auto', | ||
}, | ||
plugins: [ | ||
multi(), | ||
json(), | ||
resolve(), | ||
replace({ | ||
'PACKAGE_VERSION_INJECTED_DURING_BUILD': version, | ||
}), | ||
typescript({ target: "es5" }), | ||
commonjs() | ||
] | ||
} | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters