Skip to content

Commit

Permalink
fix templates
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Aug 24, 2020
1 parent 7803be8 commit 9dec0c0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cli/core/template/src/components/app/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export class AppController {
this.finishedRendering = Date.now() - STARTUP_TIMESTAMP;
RouterService.navigate('series');
const APP_METADATE = {
author: 'APP_AUTHOR',
homepage: 'APP_HOMEPAGE',
name: 'APP_NAME',
version: 'APP_VERSION',
author: '$$APP_AUTHOR$$',
homepage: '$$APP_HOMEPAGE$$',
name: '$$APP_NAME$$',
version: '$$APP_VERSION$$',
};
console.log('APP_METADATE', APP_METADATE);
}
Expand Down
5 changes: 4 additions & 1 deletion cli/frameworks/angular/template/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './angular.module';

if (process.env.NODE_ENV === 'production') {
const ENVs = {
NODE_ENV: '$$NODE_ENV$$',
};
if (ENVs.NODE_ENV === 'production') {
enableProdMode();
}

Expand Down
5 changes: 4 additions & 1 deletion cli/frameworks/preact/template/src/preact.main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { DI } from '@leanup/lib/helpers/injector';
import { AppComponent } from './components/app/component.preact';

// https://github.com/preactjs/preact/blob/master/README.md#debug-mode
if (process.env.NODE_ENV === 'development') {
const ENVs = {
NODE_ENV: '$$NODE_ENV$$',
};
if (ENVs.NODE_ENV === 'development') {
require('preact/debug');
}

Expand Down
9 changes: 6 additions & 3 deletions cli/frameworks/vue/template/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import App from './components/app/component.vue';
import { APP_HTML_ELEMENT } from './shares/constant';

// https://github.com/vuejs/vue-devtools
Vue.config.devtools = process.env.NODE_ENV === 'development';
const ENVs = {
NODE_ENV: '$$NODE_ENV$$',
};
Vue.config.devtools = ENVs.NODE_ENV === 'development';

DI.register('Framework', {
name: 'Vue',
version: Vue.version
version: Vue.version,
});
require('./shares/register');
require('./shares/routing');
Expand All @@ -25,6 +28,6 @@ if (htmlDivElement instanceof HTMLDivElement) {
// tslint:disable-next-line: no-unused-expression
new Vue({
el: APP_HTML_ELEMENT,
render: (h: any) => h(App)
render: (h: any) => h(App),
});
}

0 comments on commit 9dec0c0

Please sign in to comment.