-
Notifications
You must be signed in to change notification settings - Fork 93
/
webpack.config.js
44 lines (41 loc) · 1.36 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Nextcloud Cookbook app
* Main Webpack configuration file.
* Different configurations for development and build runs
* are located in the appropriate files.
*/
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const webpack = require('webpack');
const webpackConfig = require('@nextcloud/webpack-vue-config');
const { merge } = require('webpack-merge');
function cookbookConfig(env) {
const config = merge(webpackConfig, {
context: path.resolve(__dirname),
entry: {
guest: path.resolve(path.join('src', 'guest.ts')),
main: path.resolve(path.join('src', 'main.ts')),
},
// You can add this to allow access in the network. You will have to adopt the public path in main.js as well!
// devServer: {
// host: "0.0.0.0",
// },
plugins: [
new CleanWebpackPlugin(),
new webpack.DefinePlugin({
__webpack_use_dev_server__: env.dev_server || false,
}),
],
resolve: {
alias: {
cookbook: path.resolve(__dirname, 'src'),
icons: path.resolve(
__dirname,
'node_modules/vue-material-design-icons',
),
},
},
});
return config;
}
module.exports = cookbookConfig;