mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 16:08:00 +00:00
Add support for esm and cjs modules
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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 },
|
||||
],
|
||||
})
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user