This early experiment is now closed, as it is no longer up to date with developments at https://imba.io/
Use the Imba compiler (v2) to build *.imba
files from source using Rollup.
# npm:
npm install --save-dev @eulores/rollup-plugin-imba
# yarn:
yarn --dev add @eulores/rollup-plugin-imba
mkdir sample
cd sample
yarn init
yarn --dev add rollup
yarn --dev add @rollup/plugin-node-resolve
yarn --dev add @eulores/rollup-plugin-imba
Create or edit rollup.config.js
to add the rollup-plugin-imba
plugin
import resolve from '@rollup/plugin-node-resolve';
import imbaPlugin from '@eulores/rollup-plugin-imba';
export default {
input: 'src/sample.imba',
plugins: [
resolve({"extensions": ['.js', '.imba']}),
imbaPlugin()
],
output: {
file: 'build/bundle.js',
format: 'esm'
}
};
Verify the required development dependencies in package.json
{
"devDependencies": {
"@eulores/rollup-plugin-imba": "^0.0.4",
"@rollup/plugin-node-resolve": "^9.0.0"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Imba project</title>
</head>
<body>
<script src="/build/bundle.js"></script>
</body>
</html>
// use TABS to indent the code. Check how you save the source in your editor!
tag app-root
def render
<self>
<h1> "It works!"
imba.mount <app-root>
npx rollup -c