mirror of
https://github.com/directus/directus.git
synced 2026-02-01 03:45:03 -05:00
* add new sdk * update version * fixes and sdk documentation * typing updates, documentation * added missing endpoints * targeting minified version for unpkg * removed unused types file * fixed non minified versions * fix sdk exports * fix the fix * Remove old sdk * Remove old sdk docs * Install types for Jest, add npm test * Rely on npm exclusively * Remove examples folder * Move typescript down * Update sdk.md * added auto refresh and requested changes added more http test calls fixed typing issue in customized types * remove unused endpoint * updated docs * added singletons, fixed typing issues, added password handlers * rename graphql function and fixed system endpoint * Remove unused imports, fix build Co-authored-by: rijkvanzanten <rijkvanzanten@me.com> Co-authored-by: Ben Haynes <ben@rngr.org>
61 lines
1.1 KiB
JavaScript
61 lines
1.1 KiB
JavaScript
import json from '@rollup/plugin-json';
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
import typescript from 'rollup-plugin-typescript2';
|
|
import sourceMaps from 'rollup-plugin-sourcemaps';
|
|
import { terser } from 'rollup-plugin-terser';
|
|
|
|
function target(format) {
|
|
const config = {
|
|
input: 'src/index.ts',
|
|
output: {
|
|
name: 'Directus',
|
|
file: `./dist/sdk.${format}.js`,
|
|
format,
|
|
exports: 'auto',
|
|
sourcemap: true,
|
|
globals: ['axios'],
|
|
},
|
|
plugins: [
|
|
json(),
|
|
resolve({
|
|
browser: true,
|
|
}),
|
|
typescript({
|
|
tsconfig: 'tsconfig.json',
|
|
tsconfigOverride: {
|
|
compilerOptions: {
|
|
module: 'ES2015',
|
|
},
|
|
},
|
|
}),
|
|
commonjs(),
|
|
sourceMaps(),
|
|
],
|
|
};
|
|
return [
|
|
config,
|
|
{
|
|
...config,
|
|
output: {
|
|
...config.output,
|
|
file: config.output.file.replace(/\.js$/, '.min.js'),
|
|
},
|
|
plugins: [
|
|
...config.plugins,
|
|
terser({
|
|
ecma: 2015,
|
|
}),
|
|
],
|
|
},
|
|
];
|
|
}
|
|
|
|
export default [
|
|
// Browser targets
|
|
...target('iife'),
|
|
...target('umd'),
|
|
...target('esm'),
|
|
...target('system'),
|
|
];
|