2022-05-31 12:03:39 +03:00
|
|
|
commonjs({ include: '../../node_modules/.pnpm/registry.npmjs.org/**' });
|
|
|
|
|
2022-05-27 01:20:09 +03:00
|
|
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
2022-05-31 12:03:39 +03:00
|
|
|
// import ts from 'rollup-plugin-ts';
|
|
|
|
import typescript from 'rollup-plugin-typescript2';
|
2022-05-27 01:20:09 +03:00
|
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
import clear from 'rollup-plugin-clear';
|
|
|
|
import shebang from 'rollup-plugin-preserve-shebang';
|
|
|
|
import { terser } from 'rollup-plugin-terser';
|
2022-05-31 12:03:39 +03:00
|
|
|
// import swc from 'rollup-plugin-swc';
|
|
|
|
import { swc } from 'rollup-plugin-swc3';
|
2022-05-27 01:20:09 +03:00
|
|
|
|
|
|
|
const plugins = [
|
2022-05-31 12:03:39 +03:00
|
|
|
// typescript({}),
|
|
|
|
swc({
|
|
|
|
// All options are optional
|
|
|
|
include: /\.[jt]sx?$/, // default
|
|
|
|
exclude: /node_modules/, // default
|
|
|
|
tsconfig: 'tsconfig.json', // default
|
|
|
|
// And add your swc configuration here!
|
|
|
|
// "filename" will be ignored since it is handled by rollup
|
|
|
|
jsc: {},
|
|
|
|
}),
|
|
|
|
// ts({
|
|
|
|
// preserveSymlinks: true,
|
|
|
|
// }),
|
|
|
|
nodeResolve({
|
|
|
|
preserveSymlinks: true,
|
|
|
|
}),
|
|
|
|
commonjs({
|
|
|
|
preserveSymlinks: true,
|
|
|
|
}),
|
2022-05-27 01:20:09 +03:00
|
|
|
terser(),
|
|
|
|
clear({
|
|
|
|
targets: ['dist'],
|
|
|
|
}),
|
|
|
|
];
|
|
|
|
|
|
|
|
export default [
|
|
|
|
{
|
2022-05-31 12:03:39 +03:00
|
|
|
preserveSymlinks: true,
|
2022-05-27 01:20:09 +03:00
|
|
|
input: {
|
|
|
|
index: 'src/index.ts',
|
|
|
|
services: 'src/services.ts',
|
|
|
|
'internal/compilerSupport/v2': 'src/internal/compilerSupport/v2.ts',
|
|
|
|
'internal/compilerSupport/v3': 'src/internal/compilerSupport/v3.ts',
|
|
|
|
},
|
|
|
|
output: [
|
|
|
|
{
|
|
|
|
dir: 'dist/cjs',
|
|
|
|
format: 'cjs',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
dir: 'dist/esm',
|
|
|
|
format: 'esm',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
plugins: plugins,
|
|
|
|
},
|
2022-05-31 12:03:39 +03:00
|
|
|
/*
|
2022-05-27 01:20:09 +03:00
|
|
|
{
|
2022-05-31 12:03:39 +03:00
|
|
|
preserveSymlinks: true,
|
2022-05-27 01:20:09 +03:00
|
|
|
input: 'src/tools/copyMarine.ts',
|
|
|
|
output: {
|
|
|
|
file: 'dist/copyMarine.js',
|
|
|
|
format: 'cjs',
|
|
|
|
},
|
|
|
|
plugins: [shebang(), ts()],
|
|
|
|
},
|
2022-05-31 12:03:39 +03:00
|
|
|
*/
|
2022-05-27 01:20:09 +03:00
|
|
|
];
|