├── .npmignore ├── gulpfile.js ├── dist ├── es2015 │ ├── index.js │ └── aurelia-bootstrapper-webpack.js ├── native-modules │ ├── index.js │ └── aurelia-bootstrapper-webpack.js ├── index.d.ts ├── commonjs │ ├── index.js │ └── aurelia-bootstrapper-webpack.js ├── aurelia-bootstrapper-webpack.d.ts ├── system │ ├── index.js │ └── aurelia-bootstrapper-webpack.js ├── amd │ ├── index.js │ └── aurelia-bootstrapper-webpack.js └── aurelia-bootstrapper-webpack.js ├── .gitignore ├── typings.json ├── .eslintrc.json ├── .editorconfig ├── circle.yml ├── tsconfig.json ├── CONTRIBUTING.md ├── doc ├── api.json └── CHANGELOG.md ├── bower.json ├── LICENSE ├── README.md ├── karma.conf.js ├── ISSUE_TEMPLATE.md ├── package.json └── src └── index.js /.npmignore: -------------------------------------------------------------------------------- 1 | jspm_packages 2 | bower_components 3 | .idea -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | require('require-dir')('build/tasks'); 2 | -------------------------------------------------------------------------------- /dist/es2015/index.js: -------------------------------------------------------------------------------- 1 | export * from './aurelia-bootstrapper-webpack'; -------------------------------------------------------------------------------- /dist/native-modules/index.js: -------------------------------------------------------------------------------- 1 | export * from './aurelia-bootstrapper-webpack'; -------------------------------------------------------------------------------- /dist/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from 'aurelia-bootstrapper-webpack/aurelia-bootstrapper-webpack'; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | jspm_packages 3 | bower_components 4 | .idea 5 | .DS_STORE 6 | build/reports -------------------------------------------------------------------------------- /typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-bootstrapper-webpack", 3 | "main": "dist/aurelia-bootstrapper-webpack.d.ts" 4 | } 5 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./node_modules/aurelia-tools/.eslintrc.json", 3 | "rules": { 4 | "no-console": 0 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | [**.*] 13 | indent_style = space 14 | indent_size = 2 -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | ##### 2 | # Circle CI 3 | # 4 | # For running docker images on circle ci, see: https://circleci.com/docs/docker 5 | # For circle.yml explanation, see: https://circleci.com/docs/manually 6 | ##### 7 | 8 | machine: 9 | node: 10 | version: 4.2.6 11 | 12 | dependencies: 13 | pre: 14 | - npm install -g gulp 15 | - npm install -g jspm 16 | override: 17 | - npm install 18 | 19 | test: 20 | override: 21 | - gulp build 22 | -------------------------------------------------------------------------------- /dist/commonjs/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | 7 | var _aureliaBootstrapperWebpack = require('./aurelia-bootstrapper-webpack'); 8 | 9 | Object.keys(_aureliaBootstrapperWebpack).forEach(function (key) { 10 | if (key === "default" || key === "__esModule") return; 11 | Object.defineProperty(exports, key, { 12 | enumerable: true, 13 | get: function get() { 14 | return _aureliaBootstrapperWebpack[key]; 15 | } 16 | }); 17 | }); -------------------------------------------------------------------------------- /dist/aurelia-bootstrapper-webpack.d.ts: -------------------------------------------------------------------------------- 1 | import 'aurelia-polyfills'; 2 | import { 3 | initialize 4 | } from 'aurelia-pal-browser'; 5 | import { 6 | WebpackLoader 7 | } from 'aurelia-loader-webpack'; 8 | 9 | /** 10 | * Manually bootstraps an application. 11 | * @param configure A callback which passes an Aurelia instance to the developer to manually configure and start up the app. 12 | * @return A Promise that completes when configuration is done. 13 | */ 14 | export declare function bootstrap(configure: Function): Promise; -------------------------------------------------------------------------------- /dist/system/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | System.register(['./aurelia-bootstrapper-webpack'], function (_export, _context) { 4 | "use strict"; 5 | 6 | return { 7 | setters: [function (_aureliaBootstrapperWebpack) { 8 | var _exportObj = {}; 9 | 10 | for (var _key in _aureliaBootstrapperWebpack) { 11 | if (_key !== "default" && key !== "__esModule") _exportObj[_key] = _aureliaBootstrapperWebpack[_key]; 12 | } 13 | 14 | _export(_exportObj); 15 | }], 16 | execute: function () {} 17 | }; 18 | }); -------------------------------------------------------------------------------- /dist/amd/index.js: -------------------------------------------------------------------------------- 1 | define(['exports', './aurelia-bootstrapper-webpack'], function (exports, _aureliaBootstrapperWebpack) { 2 | 'use strict'; 3 | 4 | Object.defineProperty(exports, "__esModule", { 5 | value: true 6 | }); 7 | Object.keys(_aureliaBootstrapperWebpack).forEach(function (key) { 8 | if (key === "default" || key === "__esModule") return; 9 | Object.defineProperty(exports, key, { 10 | enumerable: true, 11 | get: function () { 12 | return _aureliaBootstrapperWebpack[key]; 13 | } 14 | }); 15 | }); 16 | }); -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2015", 4 | "module": "es2015", 5 | "experimentalDecorators": true, 6 | "emitDecoratorMetadata": false, 7 | "moduleResolution": "node", 8 | "stripInternal": true, 9 | "preserveConstEnums": true, 10 | "listFiles": true, 11 | "declaration": true, 12 | "removeComments": true, 13 | "lib": ["es2015", "dom"] 14 | }, 15 | "exclude": [ 16 | "node_modules", 17 | "dist", 18 | "build", 19 | "doc", 20 | "test", 21 | "config.js", 22 | "gulpfile.js", 23 | "karma.conf.js" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We'd love for you to contribute and to make this project even better than it is today! If this interests you, please begin by reading [our contributing guidelines](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). The contributing document will provide you with all the information you need to get started. Once you have read that, you will need to also [sign our CLA](http://goo.gl/forms/dI8QDDSyKR) before we can accept a Pull Request from you. More information on the process is included in the [contributor's guide](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). 4 | -------------------------------------------------------------------------------- /doc/api.json: -------------------------------------------------------------------------------- 1 | {"name":"aurelia-bootstrapper-webpack","children":[{"id":2,"name":"bootstrap","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":3,"name":"bootstrap","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Manually bootstraps an application.","returns":"A Promise that completes when configuration is done.\n"},"parameters":[{"id":4,"name":"configure","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"A callback which passes an Aurelia instance to the developer to manually configure and start up the app."},"type":{"type":"reference","name":"Function"}}],"type":{"type":"reference","name":"Promise","typeArguments":[{"type":"instrinct","name":"void"}]}}]}],"groups":[{"title":"Functions","kind":64,"children":[2]}]} -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-bootstrapper-webpack", 3 | "version": "1.1.0", 4 | "description": "Sets up the default configuration for the aurelia framework and gets you up and running quick and easy.", 5 | "keywords": [ 6 | "aurelia", 7 | "bootstrapper", 8 | "spa", 9 | "webpack" 10 | ], 11 | "homepage": "http://aurelia.io", 12 | "main": "dist/commonjs/aurelia-bootstrapper-webpack.js", 13 | "moduleType": "node", 14 | "bugs": { 15 | "url": "https://github.com/aurelia/bootstrapper-webpack/issues" 16 | }, 17 | "license": "MIT", 18 | "author": "Rob Eisenberg (http://robeisenberg.com/)", 19 | "repository": { 20 | "type": "git", 21 | "url": "http://github.com/aurelia/bootstrapper-webpack" 22 | }, 23 | "dependencies": { 24 | "aurelia-loader-webpack": "^1.0.0", 25 | "aurelia-pal": "^1.1.1", 26 | "aurelia-pal-browser": "^1.1.0", 27 | "aurelia-polyfills": "^1.0.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /doc/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | # [1.1.0](https://github.com/aurelia/bootstrapper-webpack/compare/1.0.0...v1.1.0) (2016-12-10) 3 | 4 | 5 | 6 | 7 | # [1.0.0](https://github.com/aurelia/bootstrapper-webpack/compare/1.0.0-rc.1.0.0...v1.0.0) (2016-07-27) 8 | 9 | 10 | ### Bug Fixes 11 | 12 | * **index:** initialize PAL as soon as possible ([54d385c](https://github.com/aurelia/bootstrapper-webpack/commit/54d385c)) 13 | 14 | 15 | ### Features 16 | 17 | * **index:** pass config module id along to aurelia instance if present ([93ff213](https://github.com/aurelia/bootstrapper-webpack/commit/93ff213)) 18 | 19 | 20 | 21 | 22 | # [1.0.0-rc.1.0.0](https://github.com/aurelia/bootstrapper-webpack/compare/1.0.0-beta.2.0.2...v1.0.0-rc.1.0.0) (2016-06-22) 23 | 24 | 25 | 26 | ### 1.0.0-beta.1.0.2 (2016-05-10) 27 | 28 | 29 | ### 1.0.0-beta.1.0.1 (2016-05-03) 30 | 31 | 32 | ### 1.0.0-beta.1.0.0 (2016-03-22) 33 | 34 | * Update to Babel 6 35 | 36 | ### 0.1.0 (2016-03-04) 37 | 38 | * Initial release 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010 - 2016 Blue Spire Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aurelia-bootstrapper-webpack 2 | 3 | [![npm Version](https://img.shields.io/npm/v/aurelia-bootstrapper-webpack.svg)](https://www.npmjs.com/package/aurelia-bootstrapper-webpack) 4 | [![ZenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io) 5 | [![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | [![CircleCI](https://circleci.com/gh/aurelia/bootstrapper-webpack.svg?style=shield)](https://circleci.com/gh/aurelia/bootstrapper-webpack) 7 | 8 | This library is part of the [Aurelia](http://www.aurelia.io/) platform and contains a bootstrapper, for use with Webpack, which sets up the default configuration for the Aurelia framework and gets you up and running quick and easy. 9 | 10 | > To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.aurelia.io/) and [our email list](http://eepurl.com/ces50j). We also invite you to [follow us on twitter](https://twitter.com/aureliaeffect). If you have questions, please [join our community on Gitter](https://gitter.im/aurelia/discuss) or use [stack overflow](http://stackoverflow.com/search?q=aurelia). Documentation can be found [in our developer hub](http://aurelia.io/hub.html). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome or Firefox Extension and visit any of our repository's boards. 11 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Fri Dec 05 2014 16:49:29 GMT-0500 (EST) 3 | 4 | module.exports = function(config) { 5 | config.set({ 6 | 7 | // base path that will be used to resolve all patterns (eg. files, exclude) 8 | basePath: '', 9 | 10 | 11 | // frameworks to use 12 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 13 | frameworks: ['jspm', 'jasmine'], 14 | 15 | jspm: { 16 | // Edit this to your needs 17 | loadFiles: ['src/**/*.js', 'test/**/*.js'] 18 | }, 19 | 20 | 21 | // list of files / patterns to load in the browser 22 | files: [], 23 | 24 | 25 | // list of files to exclude 26 | exclude: [ 27 | ], 28 | 29 | 30 | // preprocess matching files before serving them to the browser 31 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 32 | preprocessors: { 33 | 'test/**/*.js': ['babel'], 34 | 'src/**/*.js': ['babel'] 35 | }, 36 | 'babelPreprocessor': { 37 | options: { 38 | sourceMap: 'inline', 39 | presets: [ 'es2015-loose', 'stage-1'], 40 | plugins: [ 41 | 'syntax-flow', 42 | 'transform-decorators-legacy', 43 | 'transform-flow-strip-types' 44 | ] 45 | } 46 | }, 47 | 48 | 49 | // test results reporter to use 50 | // possible values: 'dots', 'progress' 51 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 52 | reporters: ['progress'], 53 | 54 | 55 | // web server port 56 | port: 9876, 57 | 58 | 59 | // enable / disable colors in the output (reporters and logs) 60 | colors: true, 61 | 62 | 63 | // level of logging 64 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 65 | logLevel: config.LOG_INFO, 66 | 67 | 68 | // enable / disable watching file and executing tests whenever any file changes 69 | autoWatch: true, 70 | 71 | 72 | // start these browsers 73 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 74 | browsers: ['Chrome'], 75 | 76 | 77 | // Continuous Integration mode 78 | // if true, Karma captures browsers, runs the tests and exits 79 | singleRun: false 80 | }); 81 | }; 82 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 19 | **I'm submitting a bug report** 20 | **I'm submitting a feature request** 21 | 22 | * **Library Version:** 23 | major.minor.patch-pre 24 | 25 | 26 | **Please tell us about your environment:** 27 | * **Operating System:** 28 | OSX 10.x|Linux (distro)|Windows [7|8|8.1|10] 29 | 30 | * **Node Version:** 31 | 6.2.0 32 | 36 | 37 | * **NPM Version:** 38 | 3.8.9 39 | 43 | 44 | * **JSPM OR Webpack AND Version** 45 | JSPM 0.16.32 | webpack 2.1.0-beta.17 46 | 52 | 53 | * **Browser:** 54 | all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView 55 | 56 | * **Language:** 57 | all | TypeScript X.X | ESNext 58 | 59 | 60 | **Current behavior:** 61 | 62 | 63 | **Expected/desired behavior:** 64 | 71 | 72 | 73 | * **What is the expected behavior?** 74 | 75 | 76 | * **What is the motivation / use case for changing the behavior?** 77 | -------------------------------------------------------------------------------- /dist/es2015/aurelia-bootstrapper-webpack.js: -------------------------------------------------------------------------------- 1 | import 'aurelia-polyfills'; 2 | import { initialize } from 'aurelia-pal-browser'; 3 | import { WebpackLoader } from 'aurelia-loader-webpack'; 4 | 5 | initialize(); 6 | 7 | let bootstrapQueue = []; 8 | let sharedLoader = null; 9 | let Aurelia = null; 10 | 11 | function onBootstrap(callback) { 12 | return new Promise((resolve, reject) => { 13 | if (sharedLoader) { 14 | resolve(callback(sharedLoader)); 15 | } else { 16 | bootstrapQueue.push(() => { 17 | try { 18 | resolve(callback(sharedLoader)); 19 | } catch (e) { 20 | reject(e); 21 | } 22 | }); 23 | } 24 | }); 25 | } 26 | 27 | function ready(global) { 28 | return new Promise((resolve, reject) => { 29 | if (global.document.readyState === 'complete') { 30 | resolve(global.document); 31 | } else { 32 | global.document.addEventListener('DOMContentLoaded', completed); 33 | global.addEventListener('load', completed); 34 | } 35 | 36 | function completed() { 37 | global.document.removeEventListener('DOMContentLoaded', completed); 38 | global.removeEventListener('load', completed); 39 | resolve(global.document); 40 | } 41 | }); 42 | } 43 | 44 | function handleApp(loader, appHost) { 45 | return config(loader, appHost, appHost.getAttribute('aurelia-app')); 46 | } 47 | 48 | function config(loader, appHost, configModuleId) { 49 | const aurelia = new Aurelia(loader); 50 | aurelia.host = appHost; 51 | aurelia.configModuleId = configModuleId || null; 52 | 53 | if (configModuleId) { 54 | return loader.loadModule(configModuleId).then(customConfig => customConfig.configure(aurelia)); 55 | } 56 | 57 | aurelia.use.standardConfiguration().developmentLogging(); 58 | 59 | return aurelia.start().then(() => aurelia.setRoot()); 60 | } 61 | 62 | function run() { 63 | return ready(window).then(doc => { 64 | const appHost = doc.querySelectorAll('[aurelia-app]'); 65 | const loader = new WebpackLoader(); 66 | loader.loadModule('aurelia-framework').then(m => { 67 | Aurelia = m.Aurelia; 68 | for (let i = 0, ii = appHost.length; i < ii; ++i) { 69 | handleApp(loader, appHost[i]).catch(console.error.bind(console)); 70 | } 71 | 72 | sharedLoader = loader; 73 | for (let i = 0, ii = bootstrapQueue.length; i < ii; ++i) { 74 | bootstrapQueue[i](); 75 | } 76 | bootstrapQueue = null; 77 | }); 78 | }); 79 | } 80 | 81 | export function bootstrap(configure) { 82 | return onBootstrap(loader => { 83 | const aurelia = new Aurelia(loader); 84 | return configure(aurelia); 85 | }); 86 | } 87 | 88 | run(); -------------------------------------------------------------------------------- /dist/native-modules/aurelia-bootstrapper-webpack.js: -------------------------------------------------------------------------------- 1 | import 'aurelia-polyfills'; 2 | import { initialize } from 'aurelia-pal-browser'; 3 | import { WebpackLoader } from 'aurelia-loader-webpack'; 4 | 5 | initialize(); 6 | 7 | var bootstrapQueue = []; 8 | var sharedLoader = null; 9 | var Aurelia = null; 10 | 11 | function onBootstrap(callback) { 12 | return new Promise(function (resolve, reject) { 13 | if (sharedLoader) { 14 | resolve(callback(sharedLoader)); 15 | } else { 16 | bootstrapQueue.push(function () { 17 | try { 18 | resolve(callback(sharedLoader)); 19 | } catch (e) { 20 | reject(e); 21 | } 22 | }); 23 | } 24 | }); 25 | } 26 | 27 | function ready(global) { 28 | return new Promise(function (resolve, reject) { 29 | if (global.document.readyState === 'complete') { 30 | resolve(global.document); 31 | } else { 32 | global.document.addEventListener('DOMContentLoaded', completed); 33 | global.addEventListener('load', completed); 34 | } 35 | 36 | function completed() { 37 | global.document.removeEventListener('DOMContentLoaded', completed); 38 | global.removeEventListener('load', completed); 39 | resolve(global.document); 40 | } 41 | }); 42 | } 43 | 44 | function handleApp(loader, appHost) { 45 | return config(loader, appHost, appHost.getAttribute('aurelia-app')); 46 | } 47 | 48 | function config(loader, appHost, configModuleId) { 49 | var aurelia = new Aurelia(loader); 50 | aurelia.host = appHost; 51 | aurelia.configModuleId = configModuleId || null; 52 | 53 | if (configModuleId) { 54 | return loader.loadModule(configModuleId).then(function (customConfig) { 55 | return customConfig.configure(aurelia); 56 | }); 57 | } 58 | 59 | aurelia.use.standardConfiguration().developmentLogging(); 60 | 61 | return aurelia.start().then(function () { 62 | return aurelia.setRoot(); 63 | }); 64 | } 65 | 66 | function run() { 67 | return ready(window).then(function (doc) { 68 | var appHost = doc.querySelectorAll('[aurelia-app]'); 69 | var loader = new WebpackLoader(); 70 | loader.loadModule('aurelia-framework').then(function (m) { 71 | Aurelia = m.Aurelia; 72 | for (var i = 0, ii = appHost.length; i < ii; ++i) { 73 | handleApp(loader, appHost[i]).catch(console.error.bind(console)); 74 | } 75 | 76 | sharedLoader = loader; 77 | for (var _i = 0, _ii = bootstrapQueue.length; _i < _ii; ++_i) { 78 | bootstrapQueue[_i](); 79 | } 80 | bootstrapQueue = null; 81 | }); 82 | }); 83 | } 84 | 85 | export function bootstrap(configure) { 86 | return onBootstrap(function (loader) { 87 | var aurelia = new Aurelia(loader); 88 | return configure(aurelia); 89 | }); 90 | } 91 | 92 | run(); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-bootstrapper-webpack", 3 | "version": "1.1.0", 4 | "description": "Sets up the default configuration for the aurelia framework and gets you up and running quick and easy.", 5 | "keywords": [ 6 | "aurelia", 7 | "bootstrapper", 8 | "spa", 9 | "webpack" 10 | ], 11 | "homepage": "http://aurelia.io", 12 | "bugs": { 13 | "url": "https://github.com/aurelia/bootstrapper-webpack/issues" 14 | }, 15 | "license": "MIT", 16 | "author": "Rob Eisenberg (http://robeisenberg.com/)", 17 | "main": "dist/commonjs/aurelia-bootstrapper-webpack.js", 18 | "typings": "dist/aurelia-bootstrapper-webpack.d.ts", 19 | "repository": { 20 | "type": "git", 21 | "url": "http://github.com/aurelia/bootstrapper-webpack" 22 | }, 23 | "dependencies": { 24 | "aurelia-loader-webpack": "^1.0.0", 25 | "aurelia-pal": "^1.1.1", 26 | "aurelia-pal-browser": "^1.1.0", 27 | "aurelia-polyfills": "^1.0.0" 28 | }, 29 | "devDependencies": { 30 | "aurelia-tools": "^0.2.4", 31 | "babel-dts-generator": "^0.6.1", 32 | "babel-eslint": "^6.1.2", 33 | "babel-plugin-syntax-flow": "^6.8.0", 34 | "babel-plugin-transform-decorators-legacy": "^1.3.4", 35 | "babel-plugin-transform-es2015-modules-amd": "^6.8.0", 36 | "babel-plugin-transform-es2015-modules-commonjs": "^6.11.5", 37 | "babel-plugin-transform-es2015-modules-systemjs": "^6.11.6", 38 | "babel-plugin-transform-flow-strip-types": "^6.8.0", 39 | "babel-preset-es2015": "^6.9.0", 40 | "babel-preset-es2015-loose": "^7.0.0", 41 | "babel-preset-es2015-loose-native-modules": "^1.0.0", 42 | "babel-preset-stage-1": "^6.5.0", 43 | "del": "^2.2.1", 44 | "gulp": "^3.9.1", 45 | "gulp-babel": "^6.1.2", 46 | "gulp-bump": "^2.2.0", 47 | "gulp-concat": "^2.6.0", 48 | "gulp-conventional-changelog": "^1.1.0", 49 | "gulp-eslint": "^3.0.1", 50 | "gulp-ignore": "^2.0.1", 51 | "gulp-insert": "^0.5.0", 52 | "gulp-rename": "^1.2.2", 53 | "gulp-typedoc": "^2.0.0", 54 | "gulp-typedoc-extractor": "^0.0.8", 55 | "gulp-typescript": "^2.13.6", 56 | "gulp-util": "^3.0.7", 57 | "merge2": "^1.0.2", 58 | "object.assign": "^4.0.4", 59 | "require-dir": "^0.3.0", 60 | "run-sequence": "^1.2.2", 61 | "through2": "^2.0.1", 62 | "typedoc": "^0.4.4", 63 | "typescript": "^1.9.0-dev.20160622-1.0", 64 | "vinyl": "^1.1.1", 65 | "vinyl-paths": "^2.1.0", 66 | "yargs": "^4.8.1" 67 | }, 68 | "aurelia": { 69 | "documentation": { 70 | "articles": [] 71 | }, 72 | "build": { 73 | "resources": [ 74 | "aurelia-framework", 75 | "aurelia-logging-console", 76 | "aurelia-templating-binding", 77 | "aurelia-templating-resources", 78 | "aurelia-templating-router", 79 | "aurelia-history-browser", 80 | "aurelia-event-aggregator" 81 | ] 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import 'aurelia-polyfills'; 2 | import {initialize} from 'aurelia-pal-browser'; 3 | import {WebpackLoader} from 'aurelia-loader-webpack'; 4 | initialize(); 5 | 6 | let bootstrapQueue = []; 7 | let sharedLoader = null; 8 | let Aurelia = null; 9 | 10 | function onBootstrap(callback) { 11 | return new Promise((resolve, reject) => { 12 | if (sharedLoader) { 13 | resolve(callback(sharedLoader)); 14 | } else { 15 | bootstrapQueue.push(() => { 16 | try { 17 | resolve(callback(sharedLoader)); 18 | } catch (e) { 19 | reject(e); 20 | } 21 | }); 22 | } 23 | }); 24 | } 25 | 26 | function ready(global) { 27 | return new Promise((resolve, reject) => { 28 | if (global.document.readyState === 'complete') { 29 | resolve(global.document); 30 | } else { 31 | global.document.addEventListener('DOMContentLoaded', completed); 32 | global.addEventListener('load', completed); 33 | } 34 | 35 | function completed() { 36 | global.document.removeEventListener('DOMContentLoaded', completed); 37 | global.removeEventListener('load', completed); 38 | resolve(global.document); 39 | } 40 | }); 41 | } 42 | 43 | function handleApp(loader, appHost) { 44 | return config(loader, appHost, appHost.getAttribute('aurelia-app')); 45 | } 46 | 47 | function config(loader, appHost, configModuleId) { 48 | const aurelia = new Aurelia(loader); 49 | aurelia.host = appHost; 50 | aurelia.configModuleId = configModuleId || null; 51 | 52 | if (configModuleId) { 53 | return loader.loadModule(configModuleId).then(customConfig => customConfig.configure(aurelia)); 54 | } 55 | 56 | aurelia.use 57 | .standardConfiguration() 58 | .developmentLogging(); 59 | 60 | return aurelia.start().then(() => aurelia.setRoot()); 61 | } 62 | 63 | function run() { 64 | return ready(window).then(doc => { 65 | const appHost = doc.querySelectorAll('[aurelia-app]'); 66 | const loader = new WebpackLoader(); 67 | loader.loadModule('aurelia-framework').then(m => { 68 | Aurelia = m.Aurelia; 69 | for (let i = 0, ii = appHost.length; i < ii; ++i) { 70 | handleApp(loader, appHost[i]).catch(console.error.bind(console)); 71 | } 72 | 73 | sharedLoader = loader; 74 | for (let i = 0, ii = bootstrapQueue.length; i < ii; ++i) { 75 | bootstrapQueue[i](); 76 | } 77 | bootstrapQueue = null; 78 | }); 79 | }); 80 | } 81 | 82 | /** 83 | * Manually bootstraps an application. 84 | * @param configure A callback which passes an Aurelia instance to the developer to manually configure and start up the app. 85 | * @return A Promise that completes when configuration is done. 86 | */ 87 | export function bootstrap(configure: Function): Promise { 88 | return onBootstrap(loader => { 89 | const aurelia = new Aurelia(loader); 90 | return configure(aurelia); 91 | }); 92 | } 93 | 94 | run(); 95 | -------------------------------------------------------------------------------- /dist/aurelia-bootstrapper-webpack.js: -------------------------------------------------------------------------------- 1 | import 'aurelia-polyfills'; 2 | import {initialize} from 'aurelia-pal-browser'; 3 | import {WebpackLoader} from 'aurelia-loader-webpack'; 4 | 5 | initialize(); 6 | 7 | let bootstrapQueue = []; 8 | let sharedLoader = null; 9 | let Aurelia = null; 10 | 11 | function onBootstrap(callback) { 12 | return new Promise((resolve, reject) => { 13 | if (sharedLoader) { 14 | resolve(callback(sharedLoader)); 15 | } else { 16 | bootstrapQueue.push(() => { 17 | try { 18 | resolve(callback(sharedLoader)); 19 | } catch (e) { 20 | reject(e); 21 | } 22 | }); 23 | } 24 | }); 25 | } 26 | 27 | function ready(global) { 28 | return new Promise((resolve, reject) => { 29 | if (global.document.readyState === 'complete') { 30 | resolve(global.document); 31 | } else { 32 | global.document.addEventListener('DOMContentLoaded', completed); 33 | global.addEventListener('load', completed); 34 | } 35 | 36 | function completed() { 37 | global.document.removeEventListener('DOMContentLoaded', completed); 38 | global.removeEventListener('load', completed); 39 | resolve(global.document); 40 | } 41 | }); 42 | } 43 | 44 | function handleApp(loader, appHost) { 45 | return config(loader, appHost, appHost.getAttribute('aurelia-app')); 46 | } 47 | 48 | function config(loader, appHost, configModuleId) { 49 | const aurelia = new Aurelia(loader); 50 | aurelia.host = appHost; 51 | aurelia.configModuleId = configModuleId || null; 52 | 53 | if (configModuleId) { 54 | return loader.loadModule(configModuleId).then(customConfig => customConfig.configure(aurelia)); 55 | } 56 | 57 | aurelia.use 58 | .standardConfiguration() 59 | .developmentLogging(); 60 | 61 | return aurelia.start().then(() => aurelia.setRoot()); 62 | } 63 | 64 | function run() { 65 | return ready(window).then(doc => { 66 | const appHost = doc.querySelectorAll('[aurelia-app]'); 67 | const loader = new WebpackLoader(); 68 | loader.loadModule('aurelia-framework').then(m => { 69 | Aurelia = m.Aurelia; 70 | for (let i = 0, ii = appHost.length; i < ii; ++i) { 71 | handleApp(loader, appHost[i]).catch(console.error.bind(console)); 72 | } 73 | 74 | sharedLoader = loader; 75 | for (let i = 0, ii = bootstrapQueue.length; i < ii; ++i) { 76 | bootstrapQueue[i](); 77 | } 78 | bootstrapQueue = null; 79 | }); 80 | }); 81 | } 82 | 83 | /** 84 | * Manually bootstraps an application. 85 | * @param configure A callback which passes an Aurelia instance to the developer to manually configure and start up the app. 86 | * @return A Promise that completes when configuration is done. 87 | */ 88 | export function bootstrap(configure: Function): Promise { 89 | return onBootstrap(loader => { 90 | const aurelia = new Aurelia(loader); 91 | return configure(aurelia); 92 | }); 93 | } 94 | 95 | run(); 96 | -------------------------------------------------------------------------------- /dist/commonjs/aurelia-bootstrapper-webpack.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.bootstrap = bootstrap; 7 | 8 | require('aurelia-polyfills'); 9 | 10 | var _aureliaPalBrowser = require('aurelia-pal-browser'); 11 | 12 | var _aureliaLoaderWebpack = require('aurelia-loader-webpack'); 13 | 14 | (0, _aureliaPalBrowser.initialize)(); 15 | 16 | var bootstrapQueue = []; 17 | var sharedLoader = null; 18 | var Aurelia = null; 19 | 20 | function onBootstrap(callback) { 21 | return new Promise(function (resolve, reject) { 22 | if (sharedLoader) { 23 | resolve(callback(sharedLoader)); 24 | } else { 25 | bootstrapQueue.push(function () { 26 | try { 27 | resolve(callback(sharedLoader)); 28 | } catch (e) { 29 | reject(e); 30 | } 31 | }); 32 | } 33 | }); 34 | } 35 | 36 | function ready(global) { 37 | return new Promise(function (resolve, reject) { 38 | if (global.document.readyState === 'complete') { 39 | resolve(global.document); 40 | } else { 41 | global.document.addEventListener('DOMContentLoaded', completed); 42 | global.addEventListener('load', completed); 43 | } 44 | 45 | function completed() { 46 | global.document.removeEventListener('DOMContentLoaded', completed); 47 | global.removeEventListener('load', completed); 48 | resolve(global.document); 49 | } 50 | }); 51 | } 52 | 53 | function handleApp(loader, appHost) { 54 | return config(loader, appHost, appHost.getAttribute('aurelia-app')); 55 | } 56 | 57 | function config(loader, appHost, configModuleId) { 58 | var aurelia = new Aurelia(loader); 59 | aurelia.host = appHost; 60 | aurelia.configModuleId = configModuleId || null; 61 | 62 | if (configModuleId) { 63 | return loader.loadModule(configModuleId).then(function (customConfig) { 64 | return customConfig.configure(aurelia); 65 | }); 66 | } 67 | 68 | aurelia.use.standardConfiguration().developmentLogging(); 69 | 70 | return aurelia.start().then(function () { 71 | return aurelia.setRoot(); 72 | }); 73 | } 74 | 75 | function run() { 76 | return ready(window).then(function (doc) { 77 | var appHost = doc.querySelectorAll('[aurelia-app]'); 78 | var loader = new _aureliaLoaderWebpack.WebpackLoader(); 79 | loader.loadModule('aurelia-framework').then(function (m) { 80 | Aurelia = m.Aurelia; 81 | for (var i = 0, ii = appHost.length; i < ii; ++i) { 82 | handleApp(loader, appHost[i]).catch(console.error.bind(console)); 83 | } 84 | 85 | sharedLoader = loader; 86 | for (var _i = 0, _ii = bootstrapQueue.length; _i < _ii; ++_i) { 87 | bootstrapQueue[_i](); 88 | } 89 | bootstrapQueue = null; 90 | }); 91 | }); 92 | } 93 | 94 | function bootstrap(configure) { 95 | return onBootstrap(function (loader) { 96 | var aurelia = new Aurelia(loader); 97 | return configure(aurelia); 98 | }); 99 | } 100 | 101 | run(); -------------------------------------------------------------------------------- /dist/amd/aurelia-bootstrapper-webpack.js: -------------------------------------------------------------------------------- 1 | define(['exports', 'aurelia-pal-browser', 'aurelia-loader-webpack', 'aurelia-polyfills'], function (exports, _aureliaPalBrowser, _aureliaLoaderWebpack) { 2 | 'use strict'; 3 | 4 | Object.defineProperty(exports, "__esModule", { 5 | value: true 6 | }); 7 | exports.bootstrap = bootstrap; 8 | 9 | 10 | (0, _aureliaPalBrowser.initialize)(); 11 | 12 | var bootstrapQueue = []; 13 | var sharedLoader = null; 14 | var Aurelia = null; 15 | 16 | function onBootstrap(callback) { 17 | return new Promise(function (resolve, reject) { 18 | if (sharedLoader) { 19 | resolve(callback(sharedLoader)); 20 | } else { 21 | bootstrapQueue.push(function () { 22 | try { 23 | resolve(callback(sharedLoader)); 24 | } catch (e) { 25 | reject(e); 26 | } 27 | }); 28 | } 29 | }); 30 | } 31 | 32 | function ready(global) { 33 | return new Promise(function (resolve, reject) { 34 | if (global.document.readyState === 'complete') { 35 | resolve(global.document); 36 | } else { 37 | global.document.addEventListener('DOMContentLoaded', completed); 38 | global.addEventListener('load', completed); 39 | } 40 | 41 | function completed() { 42 | global.document.removeEventListener('DOMContentLoaded', completed); 43 | global.removeEventListener('load', completed); 44 | resolve(global.document); 45 | } 46 | }); 47 | } 48 | 49 | function handleApp(loader, appHost) { 50 | return config(loader, appHost, appHost.getAttribute('aurelia-app')); 51 | } 52 | 53 | function config(loader, appHost, configModuleId) { 54 | var aurelia = new Aurelia(loader); 55 | aurelia.host = appHost; 56 | aurelia.configModuleId = configModuleId || null; 57 | 58 | if (configModuleId) { 59 | return loader.loadModule(configModuleId).then(function (customConfig) { 60 | return customConfig.configure(aurelia); 61 | }); 62 | } 63 | 64 | aurelia.use.standardConfiguration().developmentLogging(); 65 | 66 | return aurelia.start().then(function () { 67 | return aurelia.setRoot(); 68 | }); 69 | } 70 | 71 | function run() { 72 | return ready(window).then(function (doc) { 73 | var appHost = doc.querySelectorAll('[aurelia-app]'); 74 | var loader = new _aureliaLoaderWebpack.WebpackLoader(); 75 | loader.loadModule('aurelia-framework').then(function (m) { 76 | Aurelia = m.Aurelia; 77 | for (var i = 0, ii = appHost.length; i < ii; ++i) { 78 | handleApp(loader, appHost[i]).catch(console.error.bind(console)); 79 | } 80 | 81 | sharedLoader = loader; 82 | for (var _i = 0, _ii = bootstrapQueue.length; _i < _ii; ++_i) { 83 | bootstrapQueue[_i](); 84 | } 85 | bootstrapQueue = null; 86 | }); 87 | }); 88 | } 89 | 90 | function bootstrap(configure) { 91 | return onBootstrap(function (loader) { 92 | var aurelia = new Aurelia(loader); 93 | return configure(aurelia); 94 | }); 95 | } 96 | 97 | run(); 98 | }); -------------------------------------------------------------------------------- /dist/system/aurelia-bootstrapper-webpack.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | System.register(['aurelia-polyfills', 'aurelia-pal-browser', 'aurelia-loader-webpack'], function (_export, _context) { 4 | "use strict"; 5 | 6 | var initialize, WebpackLoader, bootstrapQueue, sharedLoader, Aurelia; 7 | 8 | 9 | function onBootstrap(callback) { 10 | return new Promise(function (resolve, reject) { 11 | if (sharedLoader) { 12 | resolve(callback(sharedLoader)); 13 | } else { 14 | bootstrapQueue.push(function () { 15 | try { 16 | resolve(callback(sharedLoader)); 17 | } catch (e) { 18 | reject(e); 19 | } 20 | }); 21 | } 22 | }); 23 | } 24 | 25 | function ready(global) { 26 | return new Promise(function (resolve, reject) { 27 | if (global.document.readyState === 'complete') { 28 | resolve(global.document); 29 | } else { 30 | global.document.addEventListener('DOMContentLoaded', completed); 31 | global.addEventListener('load', completed); 32 | } 33 | 34 | function completed() { 35 | global.document.removeEventListener('DOMContentLoaded', completed); 36 | global.removeEventListener('load', completed); 37 | resolve(global.document); 38 | } 39 | }); 40 | } 41 | 42 | function handleApp(loader, appHost) { 43 | return config(loader, appHost, appHost.getAttribute('aurelia-app')); 44 | } 45 | 46 | function config(loader, appHost, configModuleId) { 47 | var aurelia = new Aurelia(loader); 48 | aurelia.host = appHost; 49 | aurelia.configModuleId = configModuleId || null; 50 | 51 | if (configModuleId) { 52 | return loader.loadModule(configModuleId).then(function (customConfig) { 53 | return customConfig.configure(aurelia); 54 | }); 55 | } 56 | 57 | aurelia.use.standardConfiguration().developmentLogging(); 58 | 59 | return aurelia.start().then(function () { 60 | return aurelia.setRoot(); 61 | }); 62 | } 63 | 64 | function run() { 65 | return ready(window).then(function (doc) { 66 | var appHost = doc.querySelectorAll('[aurelia-app]'); 67 | var loader = new WebpackLoader(); 68 | loader.loadModule('aurelia-framework').then(function (m) { 69 | Aurelia = m.Aurelia; 70 | for (var i = 0, ii = appHost.length; i < ii; ++i) { 71 | handleApp(loader, appHost[i]).catch(console.error.bind(console)); 72 | } 73 | 74 | sharedLoader = loader; 75 | for (var _i = 0, _ii = bootstrapQueue.length; _i < _ii; ++_i) { 76 | bootstrapQueue[_i](); 77 | } 78 | bootstrapQueue = null; 79 | }); 80 | }); 81 | } 82 | 83 | function bootstrap(configure) { 84 | return onBootstrap(function (loader) { 85 | var aurelia = new Aurelia(loader); 86 | return configure(aurelia); 87 | }); 88 | } 89 | 90 | _export('bootstrap', bootstrap); 91 | 92 | return { 93 | setters: [function (_aureliaPolyfills) {}, function (_aureliaPalBrowser) { 94 | initialize = _aureliaPalBrowser.initialize; 95 | }, function (_aureliaLoaderWebpack) { 96 | WebpackLoader = _aureliaLoaderWebpack.WebpackLoader; 97 | }], 98 | execute: function () { 99 | 100 | initialize(); 101 | 102 | bootstrapQueue = []; 103 | sharedLoader = null; 104 | Aurelia = null; 105 | run(); 106 | } 107 | }; 108 | }); --------------------------------------------------------------------------------