Skip to content

Instantly share code, notes, and snippets.

@egoist

egoist/App.vue Secret

Created July 6, 2017 07:49
Show Gist options
  • Save egoist/5fabf27fed3c1761710fd101f282bb42 to your computer and use it in GitHub Desktop.
Save egoist/5fabf27fed3c1761710fd101f282bb42 to your computer and use it in GitHub Desktop.
Created by gist-it (https://github.com/egoist/gist-it)
<template>
<h1>hello {{ data }}</h1>
</template>
<script>
export default {
data() {
return {data: 'foo!!'}
}
}
</script>
<style>
h1 {
color: magenta;
}
</style>
<html>
<head>
<title>app</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
import Vue from 'vue'
import App from './App.vue'
new Vue({
el: '#app',
render: h => h(App)
})
{
"dependencies": {
"vue": "^2.3.4"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-preset-es2015": "^6.24.1",
"css-loader": "^0.28.4",
"html-webpack-plugin": "^2.29.0",
"vue-loader": "^13.0.0",
"vue-template-compiler": "^2.3.4",
"webpack": "^2.6.0",
"webpack-dev-server": "^2.5.0"
},
"scripts": {
"dev": "webpack-dev-server --hot --inline --config webpack.config.js",
"upload": "gist-it *.vue *.js *.json *.html"
}
}
const path = require('path')
const HTMLPlugin = require('html-webpack-plugin')
module.exports = {
entry: './index.js',
output: {
path: __dirname,
filename: 'main.js'
},
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/],
options: {
presets: [
['es2015', {modules: false}]
]
}
}, {
test: /\.vue$/,
loader: 'vue-loader'
}]
},
plugins: [
new HTMLPlugin({
title: 'app',
template: path.join(__dirname, 'index.html')
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment