Files
owl/src/index.ts
T

40 lines
1.2 KiB
TypeScript
Raw Normal View History

/**
* This file is the main file packaged by rollup (see rollup.config.js). From
* this file, we export all public owl elements.
*
* Note that dynamic values, such as a date or a commit hash are added by rollup
*/
2019-04-16 17:19:29 +02:00
export { Component } from "./component";
export { EventBus } from "./event_bus";
export { Observer } from "./observer";
2019-05-06 12:34:36 +02:00
// we need to import manually the extra directives so they can register
// themselves in QWeb, otherwise these files will not even be loaded.
2019-05-06 12:34:36 +02:00
import "./qweb_directives";
import "./qweb_extensions";
2019-05-21 14:11:40 +02:00
import { QWeb } from "./qweb_core";
export { QWeb };
2019-05-06 12:34:36 +02:00
export { connect, Store } from "./store";
import * as _utils from "./utils";
2019-03-27 15:18:25 +01:00
2019-05-21 14:11:40 +02:00
export const __info__ = {};
2019-05-06 12:34:36 +02:00
2019-05-21 14:11:40 +02:00
Object.defineProperty(__info__, "mode", {
get() {
return QWeb.dev ? "dev" : "prod";
},
set(mode: string) {
QWeb.dev = mode === "dev";
if (QWeb.dev) {
const url = `https://github.com/odoo/owl/blob/master/doc/tooling.md#development-mode`;
console.warn(
`Owl is running in 'dev' mode. This is not suitable for production use. See ${url} for more information.`
2019-05-21 14:11:40 +02:00
);
} else {
console.log(`Owl is now running in 'prod' mode.`)
2019-05-21 14:11:40 +02:00
}
}
});
export const utils = _utils;