mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 11:27:59 +00:00
36 lines
798 B
JavaScript
36 lines
798 B
JavaScript
import babel from '@rollup/plugin-babel';
|
|
import copy from 'rollup-plugin-copy';
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
|
|
const outputDirCJS = 'dist/revive-cjs';
|
|
const outputDirESM = 'dist/revive-esm';
|
|
|
|
export default {
|
|
input: ['src/resolc.js', 'src/worker.js'], // Adjust this to your main entry file
|
|
output: [
|
|
{
|
|
dir: outputDirCJS,
|
|
format: 'cjs',
|
|
exports: 'auto',
|
|
},
|
|
{
|
|
dir: outputDirESM,
|
|
format: 'esm',
|
|
},
|
|
],
|
|
plugins: [
|
|
babel({
|
|
exclude: 'node_modules/**',
|
|
presets: ['@babel/preset-env'],
|
|
babelHelpers: 'inline',
|
|
}),
|
|
resolve(),
|
|
copy({
|
|
targets: [
|
|
{ src: 'src/resolc.wasm', dest: outputDirCJS },
|
|
{ src: 'src/resolc.wasm', dest: outputDirESM },
|
|
],
|
|
})
|
|
],
|
|
};
|