Skip to content

Instantly share code, notes, and snippets.

@CuddleBunny
Created February 6, 2019 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CuddleBunny/a4a51c6f02a27f0219eda3ba4310e307 to your computer and use it in GitHub Desktop.
Save CuddleBunny/a4a51c6f02a27f0219eda3ba4310e307 to your computer and use it in GitHub Desktop.
aurelia-cli-plugin-template
/// <reference types="aurelia-loader-webpack/src/webpack-hot-interface"/>
import {Aurelia} from 'aurelia-framework'
import environment from './environment';
import {PLATFORM} from 'aurelia-pal';
import * as Bluebird from 'bluebird';
// remove out if you don't want a Promise polyfill (remove also from webpack.config.js)
Bluebird.config({ warnings: { wForgottenReturn: false } });
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.feature(PLATFORM.moduleName('resources/index'));
// Uncomment the line below to enable animation.
// aurelia.use.plugin(PLATFORM.moduleName('aurelia-animator-css'));
// if the css animator is enabled, add swap-order="after" to all router-view elements
// Anyone wanting to use HTMLImports to load views, will need to install the following plugin.
// aurelia.use.plugin(PLATFORM.moduleName('aurelia-html-import-template-loader'));
// Use js/tsconfig.json paths to mock installation from a package manager?
aurelia.use.plugin(PLATFORM.moduleName('my-aurelia-cli-plugin'));
aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');
if (environment.testing) {
aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing'));
}
return aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
}
<template>
<hello-world></hello-world>
</template>
<template>
<h1>${message}</h1>
</template>
export class HelloWorld {
message = 'Hello World!';
}
import {FrameworkConfiguration} from 'aurelia-framework';
import {HelloWorld} from './elements/hello-world';
export function configure(config: FrameworkConfiguration) {
//config.globalResources([]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment