Skip to content

Instantly share code, notes, and snippets.

@oal
Created May 12, 2018 12:28
Show Gist options
  • Save oal/de1829a97c7105c34c09cfd3ac501b1e to your computer and use it in GitHub Desktop.
Save oal/de1829a97c7105c34c09cfd3ac501b1e to your computer and use it in GitHub Desktop.
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const {IgnorePlugin} = require('webpack');
module.exports = {
mode: 'development',
entry: [
'./resources/assets/js/app.js'
],
output: {
path: path.resolve(__dirname, 'public/web'),
publicPath: "/web/",
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
},
extensions: ['.js', '.vue']
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
shadowMode: true,
loaders: {
i18n: '@kazupon/vue-i18n-loader'
}
}
},
{
test: /\.scss$/,
use: [
{
loader: 'vue-style-loader',
options: {
shadowMode: true
}
},
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
],
},
{
test: /\.css$/,
use: [
{
loader: 'vue-style-loader',
options: {
shadowMode: true
}
},
'css-loader',
],
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 8192
}
}
]
}
]
},
optimization: {
splitChunks: {
chunks: "all"
}
},
plugins: [
new IgnorePlugin(/^vertx$/),
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
chunkFilename: "[id].css"
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment