Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanFreireKondo committed Feb 7, 2018
1 parent 3fde7ea commit b78ae2b
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Node modules
node_modules/

# dist
dist/

# Packge-lock
packge-lock.json
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# hello-vue
# Hello Vue.js

A basic example using webpack & Vue.js
58 changes: 58 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!doctype html>
<html>
<head prefix="og: http://ogp.me/ns#">
<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">

<!-- facebook open graph -->

<meta property="og:title" content="">
<meta property="og:type" content="website">
<meta property="og:description" content="">
<meta property="og:image:type" content="image/png">
<meta property="og:image" content="">
<meta property="og:url" content="">

<title>Hello World - webpack & Vue.js</title>

<meta name="description" content="Hello world with webpack & Vue.js">

<link rel="canonical" href="">
<link rel="shortcut icon" href="">

<!-- manifest -->

<link rel="manifest" href="">

<!-- ios icon -->

<link rel="apple-touch-icon-precomposed" sizes="76x76" href="">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="">

<!-- css -->

<style type="text/css">

/* inline css */

</style>

<link rel="stylesheet" type="text/css" href="">

<!-- google fonts -->

<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700">

</head>
<body>

<div id="app"></div>

<!-- javascript -->

<script src="dist/bundle.js"></script>

</body>
</html>
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Vue.js",
"version": "1.0.0",
"description": "Hello world with webpack & Vue.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build-dev": "webpack --config webpack.config.js",
"build-prod": "cross-env NODE_ENV=production webpack --config webpack.config.js"
},
"devDependencies": {
"uglifyjs-webpack-plugin": "^1.1.8",
"vue": "^2.5.13",
"vue-loader": "^14.1.1",
"vue-template-compiler": "^2.5.13"
},
"dependencies": {
"cross-env": "^5.1.3",
"webpack": "^3.10.0"
}
}
19 changes: 19 additions & 0 deletions src/components/Hello.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>

<div class="hello">

<span>{{ msg }}</span>

</div>

</template>

<script>
export default {
data() {
return {
msg: 'Hello world!'
}
}
}
</script>
10 changes: 10 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Vue from 'vue';
import Hello from './components/Hello.vue'

// Hello :)

new Vue({
el: '#app',
components: { Hello },
template: '<Hello/>'
});
35 changes: 35 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const path = require('path');
const uglifyjs = require('uglifyjs-webpack-plugin');
const compiler = require('vue-template-compiler');

const env = process.env.NODE_ENV;

let plugins = [];

if (env == 'production') {

plugins.push(new uglifyjs());

}

module.exports = {
entry: './src/main.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
plugins: plugins
};

0 comments on commit b78ae2b

Please sign in to comment.