2020-08-07 15:49:13 +03:00
|
|
|
const path = require('path')
|
|
|
|
const webpackConfig = require('@nextcloud/webpack-vue-config')
|
2022-05-30 12:48:07 +03:00
|
|
|
const ESLintPlugin = require('eslint-webpack-plugin')
|
|
|
|
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
2020-08-07 15:49:13 +03:00
|
|
|
|
2020-10-14 20:22:03 +03:00
|
|
|
const buildMode = process.env.NODE_ENV
|
|
|
|
const isDev = buildMode === 'development'
|
|
|
|
webpackConfig.devtool = isDev ? 'cheap-source-map' : 'source-map'
|
2022-05-30 12:48:07 +03:00
|
|
|
// webpackConfig.bail = false
|
2020-09-02 12:14:36 +03:00
|
|
|
|
2020-10-15 19:24:08 +03:00
|
|
|
webpackConfig.stats = {
|
2022-05-30 12:48:07 +03:00
|
|
|
colors: true,
|
|
|
|
modules: false,
|
2020-10-15 19:24:08 +03:00
|
|
|
}
|
|
|
|
|
2020-10-14 20:22:03 +03:00
|
|
|
webpackConfig.entry = {
|
2022-05-30 12:48:07 +03:00
|
|
|
personalSettings: { import: path.join(__dirname, 'src', 'personalSettings.js'), filename: 'integration_github-personalSettings.js' },
|
|
|
|
adminSettings: { import: path.join(__dirname, 'src', 'adminSettings.js'), filename: 'integration_github-adminSettings.js' },
|
|
|
|
dashboard: { import: path.join(__dirname, 'src', 'dashboard.js'), filename: 'integration_github-dashboard.js' },
|
2020-08-07 15:49:13 +03:00
|
|
|
}
|
|
|
|
|
2022-05-30 12:48:07 +03:00
|
|
|
webpackConfig.plugins.push(
|
|
|
|
new ESLintPlugin({
|
|
|
|
extensions: ['js', 'vue'],
|
|
|
|
files: 'src',
|
|
|
|
failOnError: !isDev,
|
|
|
|
})
|
|
|
|
)
|
|
|
|
webpackConfig.plugins.push(
|
|
|
|
new StyleLintPlugin({
|
|
|
|
files: 'src/**/*.{css,scss,vue}',
|
|
|
|
failOnError: !isDev,
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
|
2020-10-14 20:22:03 +03:00
|
|
|
module.exports = webpackConfig
|