Skip to content

Instantly share code, notes, and snippets.

@tpitre
Created June 13, 2018 16:18
Show Gist options
  • Save tpitre/85fc2f882faea93f06c522c7ca641865 to your computer and use it in GitHub Desktop.
Save tpitre/85fc2f882faea93f06c522c7ca641865 to your computer and use it in GitHub Desktop.
Simple Vue Webpack Config
// webpack.config.js
const path = require('path');
const {VueLoaderPlugin} = require('vue-loader');
module.exports = {
entry: {
bundle: './app/src/index.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, './app/dist/'),
publicPath: path.resolve(__dirname, './app/dist/')
},
module: {
rules: [
{
test: /\.js$/,
exclude: path.resolve(__dirname, '/node_modules/'),
use: {
loader: 'babel-loader'
},
},
{
test: /\.vue$/,
loader: 'vue-loader'
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
plugins: [new VueLoaderPlugin()]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment