Initial commit
This commit is contained in:
10
index.html
Normal file
10
index.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Webpack Hello World</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="dist/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
19
package.json
Normal file
19
package.json
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
23
src/index.js
Normal file
23
src/index.js
Normal file
@@ -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: '<h3>hello world!</h3>'
|
||||
}
|
||||
|
||||
var aboutState = {
|
||||
name: 'about',
|
||||
url: '/about',
|
||||
template: '<h3>Its the UI-Router hello world app!</h3>'
|
||||
}
|
||||
|
||||
$stateProvider.state(helloState);
|
||||
$stateProvider.state(aboutState);
|
||||
});
|
||||
9
webpack.config.js
Normal file
9
webpack.config.js
Normal file
@@ -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
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user