rollup config

This commit is contained in:
Alexander Popov 2023-05-10 01:28:36 +03:00
parent 0dbbfc1663
commit 87bc10094e
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
7 changed files with 12 additions and 1 deletions

View File

@ -1,8 +1,10 @@
{ {
"private": true, "private": true,
"type": "module",
"version": "beeeeeeta", "version": "beeeeeeta",
"scripts": { "scripts": {
"build": "rm -rf ./dist/ && rollup src/js/main.js --file dist/engine-$(npm pkg get version | tr -d '\"').js --format es", "build": "rollup --config rollup.config.js",
"watch": "ROLLUP_WATCH=true rollup --config rollup.config.js --watch",
"prettier-check": "prettier --check .", "prettier-check": "prettier --check .",
"prettier-write": "prettier --write .", "prettier-write": "prettier --write .",
"editorconfig-check": "ec -exclude 'node_modules' .", "editorconfig-check": "ec -exclude 'node_modules' .",

9
rollup.config.js Normal file
View File

@ -0,0 +1,9 @@
import pkg from './package.json' assert { type: 'json' };
export default {
input: 'src/main.js',
output: {
file: `dist/engine-${pkg.version}.js`,
format: 'es',
},
};