From 55ce46026188622c7ea8d12154dea8d5dece1ae6 Mon Sep 17 00:00:00 2001 From: AndroidDrew Date: Thu, 4 Jan 2018 15:09:17 -0500 Subject: [PATCH] Initial commit --- .gitignore | 1 + app.js | 11 +++++++++++ index.html | 19 +++++++++++++++++++ package.json | 14 ++++++++++++++ webpack.config.js | 26 ++++++++++++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 .gitignore create mode 100644 app.js create mode 100644 index.html create mode 100644 package.json create mode 100644 webpack.config.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/app.js b/app.js new file mode 100644 index 0000000..04a8083 --- /dev/null +++ b/app.js @@ -0,0 +1,11 @@ +// app.js +// import Vue from './node_modules/vue/dist/vue.esm.browser.js' + +const app = new Vue({ + el: '#app', + data() { + return { + message: 'Hello Webpack integration with vuejs' + } + } +}) diff --git a/index.html b/index.html new file mode 100644 index 0000000..a6e25fc --- /dev/null +++ b/index.html @@ -0,0 +1,19 @@ + + + + + Vuejs Webpack + + + +
+ {{message}} +
+ + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..a7e7fdc --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "vuejs_webpack", + "version": "1.0.0", + "description": "Example project using webpack with vuejs", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "drew@androiddrew.com", + "license": "MIT", + "dependencies": { + "vue": "^2.5.13" + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..9cf6093 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,26 @@ +module.exports = { + // Entry file + entry: './app.js', + output: { + //output bundle + filename: 'bundle.js' + }, + modules: { + rules: [ + { + // For .js files + test: /\.js$/, + use: { + // Use the babel loader + loader: 'bable-loader' + } + } + ] + }, + resolve: { + alias: { + // Ensure the right Vue build is used + 'vue$': 'vue/dist/vue.esm.js' + } + } +}