commit cf80a0df03e847ec010a433a63fd89db7488f748 Author: Niels Kooiman Date: Tue Sep 19 17:51:06 2017 +0200 Initial commit diff --git a/index.html b/index.html new file mode 100644 index 0000000..79d2676 --- /dev/null +++ b/index.html @@ -0,0 +1,10 @@ + + + + + Webpack Hello World + + + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..05d0fbe --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "angular-webpack-app", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@uirouter/angularjs": "^1.0.6", + "angular": "^1.6.6" + }, + "devDependencies": { + "webpack": "^3.6.0", + "webpack-dev-server": "^2.8.2" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..f6947b7 --- /dev/null +++ b/src/index.js @@ -0,0 +1,23 @@ +import angular from 'angular' +import uirouter from '@uirouter/angularjs' + + +var app = angular.module('app', ['ui.router']); + +app.config(function($stateProvider) { + + var helloState = { + name: 'hello', + url: '/hello', + template: '

hello world!

' + } + + var aboutState = { + name: 'about', + url: '/about', + template: '

Its the UI-Router hello world app!

' + } + + $stateProvider.state(helloState); + $stateProvider.state(aboutState); +}); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..5203aad --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,9 @@ +const path = require('path'); + +module.exports = { + entry: "./src/index.js", // bundle's entry point + output: { + path: path.resolve(__dirname, 'dist'), // output directory + filename: 'bundle.js' // name of the generated bundle + } +};