Clone engine262 in /engine262

This commit is contained in:
2020-09-07 10:19:00 +05:30
parent 7688de2e5c
commit 66c1aeb9e0
313 changed files with 46014 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
'use strict';
const fs = require('fs');
const { execSync } = require('child_process');
const { babel } = require('@rollup/plugin-babel');
const commonjs = require('@rollup/plugin-commonjs');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const { name, version } = require('./package.json');
const hash = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
const banner = `/*!
* engine262 ${version} ${hash}
*
* ${fs.readFileSync('./LICENSE', 'utf8').trim().split('\n').join('\n * ')}
*/
`;
module.exports = () => ({
input: './src/api.mjs',
plugins: [
commonjs(),
nodeResolve(),
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
plugins: [
'./scripts/transform.js',
],
}),
],
output: [
{
file: 'dist/engine262.js',
format: 'umd',
sourcemap: true,
name,
banner,
},
{
file: 'dist/engine262.mjs',
format: 'es',
sourcemap: true,
banner,
},
],
onwarn(warning, warn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') {
// Squelch.
return;
}
process.exitCode = 1;
warn(warning);
},
});