Unify webpack config

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2019-05-24 14:08:39 +02:00
parent 21f9487939
commit b53a9130a6
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF
16 changed files with 114 additions and 407 deletions

View file

@ -1,5 +1,4 @@
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src', 'main.js'),
@ -7,22 +6,5 @@ module.exports = {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: 'accessibility.js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
},
plugins: [new VueLoaderPlugin()],
resolve: {
extensions: ['*', '.js', '.vue', '.json']
}
};
}

View file

@ -1,4 +1,4 @@
const path = require('path');
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src', 'comments.js'),
@ -7,34 +7,7 @@ module.exports = {
publicPath: '/js/',
filename: 'comments.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
externals: {
jquery: 'jQuery'
},
resolve: {
extensions: ['*', '.js']
}
};
}

View file

@ -1,5 +1,4 @@
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: {
@ -12,31 +11,5 @@ module.exports = {
publicPath: '/js/',
filename: '[name].js',
chunkFilename: 'files_sharing.[id].js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
},
plugins: [new VueLoaderPlugin()],
resolve: {
extensions: ['*', '.js', '.vue', '.json']
},
};
}
}

View file

@ -1,4 +1,4 @@
const path = require('path');
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src', 'files_trashbin.js'),
@ -6,32 +6,5 @@ module.exports = {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: 'files_trashbin.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
extensions: ['*', '.js']
}
};
}

View file

@ -1,4 +1,4 @@
const path = require('path');
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src', 'files_versions.js'),
@ -6,36 +6,5 @@ module.exports = {
path: path.resolve(__dirname, 'js'),
publicPath: '/js/',
filename: 'files_versions.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
},
{
test: /\.handlebars$/,
loader: "handlebars-loader"
}
]
},
resolve: {
extensions: ['*', '.js']
}
};
}

View file

@ -1,32 +1,10 @@
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: path.join(__dirname, 'src', 'main.js'),
output: {
path: path.resolve(__dirname, './js'),
publicPath: '/js',
filename: 'oauth2.js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
]
},
plugins: [
new VueLoaderPlugin()
],
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
}
entry: path.join(__dirname, 'src', 'main.js'),
output: {
path: path.resolve(__dirname, './js'),
publicPath: '/js',
filename: 'oauth2.js'
}
}

View file

@ -1,4 +1,4 @@
const path = require('path');
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src', 'systemtags.js'),
@ -6,32 +6,5 @@ module.exports = {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: 'systemtags.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
extensions: ['*', '.js']
}
};
}

View file

@ -1,5 +1,4 @@
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src', 'settings.js'),
@ -7,40 +6,5 @@ module.exports = {
path: path.resolve(__dirname, 'js'),
publicPath: '/js',
filename: 'settings.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
plugins: [new VueLoaderPlugin()],
resolve: {
alias: {
vue$: 'vue/dist/vue.esm.js',
},
extensions: ['*', '.js', '.vue', '.json']
}
};
}

View file

@ -409,7 +409,7 @@
}
</script>
<style lang="sass" scoped>
<style lang="scss" scoped>
#updatenotification {
margin-top: -25px;
margin-bottom: 200px;
@ -482,7 +482,7 @@
}
}
</style>
<style lang="sass">
<style lang="scss">
/* override needed to make menu wider */
#updatenotification .popovermenu {
p {

View file

@ -1,5 +1,4 @@
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'src', 'init.js'),
@ -7,26 +6,5 @@ module.exports = {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: 'updatenotification.js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.s[a|c]ss$/,
loader: 'style-loader!css-loader!sass-loader'
}
]
},
plugins: [new VueLoaderPlugin()],
resolve: {
extensions: ['*', '.js', '.vue', '.json']
}
};
}

View file

@ -9,36 +9,13 @@ module.exports = {
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
},
{
test: /\.handlebars$/,
loader: "handlebars-loader",
options: {
helperDirs: path.join(__dirname, 'src/hbs_helpers'),
}
},
}
]
},
resolve: {
extensions: ['*', '.js', '.handlebars']
}
};
}

View file

@ -1,6 +1,5 @@
const path = require('path');
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader');
const path = require('path')
const webpack = require('webpack')
module.exports = [
{
@ -15,41 +14,9 @@ module.exports = [
},
module: {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'style-loader', 'css-loader', 'sass-loader']
},
{
test: /davclient/,
use: 'exports-loader?dav'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.(png|jpg|gif)$/,
loader: 'url-loader',
options: {
name: '[name].[ext]?[hash]',
limit: 8192
}
},
{
test: /\.handlebars/,
loader: "handlebars-loader",
query: {
extensions: '.handlebars'
}
}
]
},
@ -58,16 +25,8 @@ module.exports = [
'_': "underscore",
$: "jquery",
jQuery: "jquery"
}),
new VueLoaderPlugin(),
],
resolve: {
alias: {
handlebars: 'handlebars/runtime'
},
extensions: ['*', '.js'],
symlinks: false
}
})
]
},
{
entry: {
@ -77,23 +36,6 @@ module.exports = [
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'js/dist')
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
]
}
}
];
]

View file

@ -1,5 +1,4 @@
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: {
@ -16,36 +15,5 @@ module.exports = {
splitChunks: {
automaticNameDelimiter: '-',
}
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader', 'css-loader'
],
},
{
test: /\.scss$/,
use: [
'vue-style-loader', 'css-loader', 'sass-loader'
],
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
]
},
plugins: [
new VueLoaderPlugin()
],
resolve: {
extensions: ['*', '.js', '.vue', '.json']
}
}

View file

@ -1,28 +1,85 @@
const core = require('./core/webpack')
const settings = require('./settings/webpack')
const path = require('path');
const merge = require('webpack-merge');
const { VueLoaderPlugin } = require('vue-loader');
const accessibility = require('./apps/accessibility/webpack')
const comments = require('./apps/comments/webpack')
const files_sharing = require('./apps/files_sharing/webpack')
const files_trashbin = require('./apps/files_trashbin/webpack')
const files_versions = require('./apps/files_versions/webpack')
const oauth2 = require('./apps/oauth2/webpack')
const systemtags = require('./apps/systemtags/webpack')
const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack')
const updatenotifications = require('./apps/updatenotification/webpack')
const workflowengine = require('./apps/workflowengine/webpack')
const core = require('./core/webpack');
const settings = require('./settings/webpack');
module.exports = [].concat(
core,
settings,
accessibility,
comments,
files_sharing,
files_trashbin,
files_versions,
oauth2,
systemtags,
twofactor_backupscodes,
updatenotifications,
workflowengine
);
const accessibility = require('./apps/accessibility/webpack');
const comments = require('./apps/comments/webpack');
const files_sharing = require('./apps/files_sharing/webpack');
const files_trashbin = require('./apps/files_trashbin/webpack');
const files_versions = require('./apps/files_versions/webpack');
const oauth2 = require('./apps/oauth2/webpack');
const systemtags = require('./apps/systemtags/webpack');
const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack');
const updatenotifications = require('./apps/updatenotification/webpack');
const workflowengine = require('./apps/workflowengine/webpack');
module.exports = []
.concat(
core,
settings,
accessibility,
comments,
files_sharing,
files_trashbin,
files_versions,
oauth2,
systemtags,
twofactor_backupscodes,
updatenotifications,
workflowengine
)
.map(config =>
merge(config, {
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.(png|jpg|gif)$/,
loader: 'url-loader',
options: {
name: '[name].[ext]?[hash]',
limit: 8192
}
},
{
test: /\.handlebars/,
loader: "handlebars-loader",
query: {
extensions: '.handlebars'
}
}
]
},
plugins: [
new VueLoaderPlugin()
],
resolve: {
alias: {
OC: path.resolve(__dirname, './core/src/OC'),
OCA: path.resolve(__dirname, './core/src/OCA'),
// make sure to use the handlebar runtime when importing
handlebars: 'handlebars/runtime'
},
extensions: ['*', '.js', '.vue', '.json']
}
})
);