diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-01-09 20:16:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 20:16:05 +0100 |
commit | 011aab52ff3c64dcf650ac8aa5c34665b70cc75a (patch) | |
tree | cf6f7662197d78d109cc6e9dd482cd11afeed658 /core/webpack.common.js | |
parent | 62b4f961124f8865508c29f38d7a9429ae47f700 (diff) | |
parent | 1728075946ded49e66867ea020243b735607a655 (diff) | |
download | nextcloud-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.js | 51 |
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 + } +}; |