2020-04-18 11:04:31 +03:00
|
|
|
/**
|
|
|
|
* Nextcloud Cookbook app
|
|
|
|
* Main Webpack configuration file.
|
|
|
|
* Different configurations for development and build runs
|
|
|
|
* are located in the appropriate files.
|
|
|
|
*/
|
|
|
|
const path = require('path')
|
2021-12-07 17:33:44 +03:00
|
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
2020-04-18 11:04:31 +03:00
|
|
|
|
2022-03-06 21:39:16 +03:00
|
|
|
const webpack = require('webpack')
|
|
|
|
const webpackConfig = require('@nextcloud/webpack-vue-config')
|
|
|
|
const { merge } = require('webpack-merge')
|
2020-04-18 11:04:31 +03:00
|
|
|
|
2022-07-01 11:59:17 +03:00
|
|
|
function cookbookConfig (env) {
|
|
|
|
const config = merge(webpackConfig, {
|
2023-01-14 16:05:51 +03:00
|
|
|
context: path.resolve(__dirname),
|
2022-07-01 11:59:17 +03:00
|
|
|
entry: {
|
|
|
|
guest: path.resolve(path.join('src', 'guest.js')),
|
|
|
|
},
|
|
|
|
// 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': {
|
2022-07-24 14:11:17 +03:00
|
|
|
cookbook: path.resolve(__dirname, 'src'),
|
|
|
|
icons: path.resolve(__dirname, 'node_modules/vue-material-design-icons'),
|
2022-07-01 11:59:17 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|
|
|
|
return config
|
|
|
|
}
|
2022-03-06 21:39:16 +03:00
|
|
|
|
2022-07-01 11:59:17 +03:00
|
|
|
module.exports = cookbookConfig
|