Created
May 12, 2022 12:25
-
-
Save kirilkirkov/b1bc23dfdd23c71695fc7ee2f65ec3b7 to your computer and use it in GitHub Desktop.
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 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