nextcloud-app-radio/webpack.js
2020-11-24 15:50:12 +01:00

38 lines
817 B
JavaScript

const { merge } = require('webpack-merge')
const path = require('path')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const config = {
entry: {
dashboard: path.join(__dirname, 'src', 'dashboard.js'),
},
module: {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader', 'postcss-loader'],
},
{
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'postcss-loader',
'sass-loader',
],
},
{
test: /\.vue$/,
use: ['vue-loader'],
},
],
},
}
const mergedConfigs = merge(config, webpackConfig)
// Remove duplicate rules by the `test` key
mergedConfigs.module.rules = mergedConfigs.module.rules.filter((v, i, a) => a.findIndex(t => (t.test.toString() === v.test.toString())) === i)
module.exports = mergedConfigs