From 329da5fb992f6a3400fd20f34efb1752f05030e5 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 11 Feb 2019 19:30:16 +0100 Subject: Move webpack config to root Then we can include all server repo webpack configs in 1 go Signed-off-by: Roeland Jago Douma --- core/webpack.common.js | 87 -------------------------------------------------- core/webpack.dev.js | 9 ------ core/webpack.js | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ core/webpack.prod.js | 9 ------ package.json | 4 +-- webpack.common.js | 3 ++ webpack.dev.js | 9 ++++++ webpack.prod.js | 9 ++++++ 8 files changed, 110 insertions(+), 107 deletions(-) delete mode 100644 core/webpack.common.js delete mode 100644 core/webpack.dev.js create mode 100644 core/webpack.js delete mode 100644 core/webpack.prod.js create mode 100644 webpack.common.js create mode 100644 webpack.dev.js create mode 100644 webpack.prod.js diff --git a/core/webpack.common.js b/core/webpack.common.js deleted file mode 100644 index 651bffaad9f..00000000000 --- a/core/webpack.common.js +++ /dev/null @@ -1,87 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); - -module.exports = [ - { - entry: { - main: path.join(__dirname, 'src/main.js'), - }, - output: { - filename: '[name].js', - path: path.resolve(__dirname, 'js/dist') - }, - module: { - rules: [ - { - test: /\.css$/, - use: ['style-loader', 'css-loader'] - }, - { - test: /davclient/, - use: 'exports-loader?dav' - }, - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /\.(png|jpg|gif)$/, - loader: 'url-loader', - options: { - name: '[name].[ext]?[hash]', - limit: 8192 - } - }, - { - test: /\.handlebars/, - loader: "handlebars-loader", - query: { - extensions: '.handlebars' - } - } - ] - }, - plugins: [ - new webpack.ProvidePlugin({ - '_': "underscore", - $: "jquery", - jQuery: "jquery" - }) - ], - resolve: { - alias: { - handlebars: 'handlebars/runtime' - }, - extensions: ['*', '.js'], - symlinks: false - } - }, - { - entry: { - share_backend: path.resolve(__dirname, 'js/merged-share-backend.js'), - systemtags: path.resolve(__dirname, 'js/systemtags/merged-systemtags.js') - }, - 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'] - }, - ] - } - } -]; diff --git a/core/webpack.dev.js b/core/webpack.dev.js deleted file mode 100644 index 8de803b5683..00000000000 --- a/core/webpack.dev.js +++ /dev/null @@ -1,9 +0,0 @@ -const merge = require('webpack-merge'); -const common = require('./webpack.common.js'); - -module.exports = common.map( - config => merge(config, { - mode: 'development', - devtool: 'cheap-source-map', - }) -) diff --git a/core/webpack.js b/core/webpack.js new file mode 100644 index 00000000000..651bffaad9f --- /dev/null +++ b/core/webpack.js @@ -0,0 +1,87 @@ +const path = require('path'); +const webpack = require('webpack'); + +module.exports = [ + { + entry: { + main: path.join(__dirname, 'src/main.js'), + }, + output: { + filename: '[name].js', + path: path.resolve(__dirname, 'js/dist') + }, + module: { + rules: [ + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /davclient/, + use: 'exports-loader?dav' + }, + { + test: /\.js$/, + loader: 'babel-loader', + exclude: /node_modules/ + }, + { + test: /\.(png|jpg|gif)$/, + loader: 'url-loader', + options: { + name: '[name].[ext]?[hash]', + limit: 8192 + } + }, + { + test: /\.handlebars/, + loader: "handlebars-loader", + query: { + extensions: '.handlebars' + } + } + ] + }, + plugins: [ + new webpack.ProvidePlugin({ + '_': "underscore", + $: "jquery", + jQuery: "jquery" + }) + ], + resolve: { + alias: { + handlebars: 'handlebars/runtime' + }, + extensions: ['*', '.js'], + symlinks: false + } + }, + { + entry: { + share_backend: path.resolve(__dirname, 'js/merged-share-backend.js'), + systemtags: path.resolve(__dirname, 'js/systemtags/merged-systemtags.js') + }, + 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'] + }, + ] + } + } +]; diff --git a/core/webpack.prod.js b/core/webpack.prod.js deleted file mode 100644 index 7cf446b9be5..00000000000 --- a/core/webpack.prod.js +++ /dev/null @@ -1,9 +0,0 @@ -const merge = require('webpack-merge') -const common = require('./webpack.common.js') - -module.exports = common.map( - config => merge(config, { - mode: 'production', - devtool: '#source-map', - }) -) diff --git a/package.json b/package.json index 580bbb975d6..caae290a8e0 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "test": "tests" }, "scripts": { - "build": "webpack --progress --hide-modules --config core/webpack.prod.js", - "dev": "webpack --progress --watch --config core/webpack.dev.js" + "build": "webpack --progress --hide-modules --config webpack.prod.js", + "dev": "webpack --progress --watch --config webpack.dev.js" }, "repository": { "type": "git", diff --git a/webpack.common.js b/webpack.common.js new file mode 100644 index 00000000000..a182fd74244 --- /dev/null +++ b/webpack.common.js @@ -0,0 +1,3 @@ +const core = require('./core/webpack'); + +module.exports = [].concat(core); diff --git a/webpack.dev.js b/webpack.dev.js new file mode 100644 index 00000000000..8de803b5683 --- /dev/null +++ b/webpack.dev.js @@ -0,0 +1,9 @@ +const merge = require('webpack-merge'); +const common = require('./webpack.common.js'); + +module.exports = common.map( + config => merge(config, { + mode: 'development', + devtool: 'cheap-source-map', + }) +) diff --git a/webpack.prod.js b/webpack.prod.js new file mode 100644 index 00000000000..7cf446b9be5 --- /dev/null +++ b/webpack.prod.js @@ -0,0 +1,9 @@ +const merge = require('webpack-merge') +const common = require('./webpack.common.js') + +module.exports = common.map( + config => merge(config, { + mode: 'production', + devtool: '#source-map', + }) +) -- cgit v1.2.3