I am making spa application in phalcon. I would like to use scss, vue for my assets and compile them using webpack 4 where I am newbie. I found minicssextract plugin which compiles css files but I don't understand why it cannot find appropriate type. Here is my configuration:
let path = require('path');
let webpack = require('webpack');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const devMode = process.env.NODE_ENV !== 'production';
module.exports = {
entry: [
'./resources/js/app.js',
'./resources/scss/app.sсss'
],
output: {
path : path.resolve(__dirname, './public/oauth/js'),
publicPath : '/oauth/js/',
filename : 'app.js',
},
devtool: "source-map",
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: file => (
/node_modules/.test(file) &&
!/\.vue\.js/.test(file)
)
},
{
test: /\.(sa|sc|c)ss$/,
use: [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: devMode ? '[name].css' : '[name].[hash].css',
chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
}),
new VueLoaderPlugin()
]
};
But it shows the following errors:
ERROR in ./resources/scss/app.sсss 1:2 Module parse failed: Unexpected token (1:2) You may need an appropriate loader to handle this file type.
h1{ | color: red; | }
@ multi ./resources/js/app.js ./resources/scss/app.sсss main[1]