This repo is an example on how to start a real project with the Odoo OWL framework in version 2.
- OWL v2.0.5
- Javascript
- Vite
- TailwindCSS
Otherwise, you may clone it:
git clone https://github.com/Coding-Dodo/OWL2-JavaScript-Project-Starter.git
Install dependencies:
pnpm i
Dev with HMR:
pnpm dev
Production build
pnpm build
Preview Production build
pnpm preview
Run tests
pnpm test
It is expected to create components in one file, following this convention:
import { Component, useState, tags } from "@odoo/owl";
const APP_TEMPLATE = tags.xml/*xml*/ `
<div t-name="App" class="" t-on-click="update">
Hello <t t-esc="state.text"/>
</div>
`;
export class App extends Component {
static template = APP_TEMPLATE;
state = useState({ text: "Owl" });
update() {
this.state.text = this.state.text === "Owl" ? "World" : "Owl";
}
}
If your are searching for OWL version 1 project starter with Tailwind and PostCSS:
https://github.com/Coding-Dodo/OWL-JavaScript-Tailwind-Project-Starter