aboutsummaryrefslogtreecommitdiffstats
path: root/core/webpack.common.js
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-01-09 20:16:05 +0100
committerGitHub <noreply@github.com>2019-01-09 20:16:05 +0100
commit011aab52ff3c64dcf650ac8aa5c34665b70cc75a (patch)
treecf6f7662197d78d109cc6e9dd482cd11afeed658 /core/webpack.common.js
parent62b4f961124f8865508c29f38d7a9429ae47f700 (diff)
parent1728075946ded49e66867ea020243b735607a655 (diff)
downloadnextcloud-server-011aab52ff3c64dcf650ac8aa5c34665b70cc75a.tar.gz
nextcloud-server-011aab52ff3c64dcf650ac8aa5c34665b70cc75a.zip
Merge pull request #13156 from nextcloud/enhancement/npmize
Use npm for js depdencies, bundle with webpack
Diffstat (limited to 'core/webpack.common.js')
-rw-r--r--core/webpack.common.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/core/webpack.common.js b/core/webpack.common.js
new file mode 100644
index 00000000000..edb6f483601
--- /dev/null
+++ b/core/webpack.common.js
@@ -0,0 +1,51 @@
+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
+ }
+ }
+ ]
+ },
+ plugins: [
+ new webpack.ProvidePlugin({
+ '_': "underscore",
+ $: "jquery",
+ jQuery: "jquery"
+ })
+ ],
+ resolve: {
+ alias: {
+ handlebars: 'handlebars/dist/handlebars.min.js'
+ },
+ extensions: ['*', '.js'],
+ symlinks: false
+ }
+};