Last active
November 28, 2019 06:56
-
-
Save crookse/c708376cb3d8ce426efe60cb5c6acfc3 to your computer and use it in GitHub Desktop.
Vue: Automate Your Routing - webpack.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require("webpack"); | |
const path = require("path"); | |
const VueLoaderPlugin = require("vue-loader/lib/plugin"); | |
module.exports = { | |
entry: path.resolve(__dirname, "assets/bundle.js"), | |
mode: "development", | |
output: { | |
path: path.resolve(__dirname, "assets/"), | |
filename: "bundle.compiled.js" | |
}, | |
module: { | |
rules: [ | |
// this will apply to both plain `.js` files AND `<script>` blocks in `.vue` files | |
{ | |
test: /\.js$/, | |
loader: "babel-loader" | |
}, | |
// this will apply to the `<template lang="pug">` blocks in `.vue` files | |
{ | |
test: /\.pug$/, | |
loader: "pug-plain-loader" | |
}, | |
// this will apply to `.vue` files | |
{ | |
test: /\.vue$/, | |
loader: "vue-loader" | |
}, | |
], | |
}, | |
resolve: { | |
alias: { | |
'vue$': 'vue/dist/vue.esm.js' | |
}, | |
}, | |
plugins: [ | |
// make sure to include the plugin! | |
new VueLoaderPlugin(), | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment