Browse Source

npx imba create (module)

master
Marek Piasecki 2 years ago
parent
commit
d8a9846c5f
  1. 27
      .gitignore
  2. 11
      index.html
  3. 5182
      package-lock.json
  4. 27
      package.json
  5. 3
      readme.md
  6. 1
      src/index.js
  7. 16
      src/main.imba
  8. 15
      vite.config.js

27
.gitignore

@ -0,0 +1,27 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
coverage

11
index.html

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Imba Module</title>
</head>
<body>
<script type="module" src="/src/index.js"></script>
</body>
</html>

5182
package-lock.json

File diff suppressed because it is too large

27
package.json

@ -0,0 +1,27 @@
{
"name": "pro-router-imba2",
"type": "module",
"files": [
"dist"
],
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.umd.cjs"
}
},
"scripts": {
"dev": "vite",
"start": "vite",
"build": "vite build",
"watch": "vite build --watch",
"preview": "vite preview"
},
"devDependencies": {
"imba": "^2.0.0-alpha.226",
"vite": "^3.2.5",
"vite-plugin-imba": "^0.10.1"
}
}

3
readme.md

@ -0,0 +1,3 @@
# Module Template
See https://github.com/imba/imba.io/pull/255 for most up-to-date usage guide.

1
src/index.js

@ -0,0 +1 @@
import "./main.imba"

16
src/main.imba

@ -0,0 +1,16 @@
export let state = {
count: 0
}
export def increment
state.count++
tag app
<self@click=increment> "count is {state.count}"
css d:inline-block us:none cursor:pointer fs:6 p:2.5 5 rd:2.5
tween:box-shadow 250ms, background-color 250ms
ff:Arial c:black/87 bg:indigo4 bxs:xs
@hover bg:indigo3 bxs:lg
if import.meta.env.MODE is 'development'
imba.mount <app>

15
vite.config.js

@ -0,0 +1,15 @@
import { imba } from 'vite-plugin-imba';
import { resolve } from 'path'
import { defineConfig } from 'vite';
import { name } from './package.json'
export default defineConfig({
plugins: [imba()],
build: {
lib: {
name: name,
fileName: "index",
entry: resolve(__dirname, 'src/main.imba'),
},
},
});
Loading…
Cancel
Save