Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kirilkirkov/b1bc23dfdd23c71695fc7ee2f65ec3b7 to your computer and use it in GitHub Desktop.
Save kirilkirkov/b1bc23dfdd23c71695fc7ee2f65ec3b7 to your computer and use it in GitHub Desktop.
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const isDevelopment = true
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
app: './resources/js/entry-server.js',
},
mode: isDevelopment ? 'development' : 'production',
target: 'node',
devtool: 'source-map',
output: {
filename: 'entry-server.js',
path: __dirname + '/public/js'
},
module: {
rules: [
{
test: /\.vue$/,
use: ['vue-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(sass|scss)$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader',
{
loader: 'postcss-loader',
options: {
plugins: () => [autoprefixer()]
}
},
'sass-loader'],
}),
},
{
test: /\.css$/,
// important: use vue-style-loader instead of style-loader
use: ['vue-style-loader', 'css-loader']
}
]
},
plugins: [
new VueLoaderPlugin(),
],
resolve: {
extensions: ['*', '.js', '.vue', '.json']
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment