-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
31 lines (27 loc) · 888 Bytes
/
webpack.config.js
File metadata and controls
31 lines (27 loc) · 888 Bytes
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
const webpackConfig = require('@nextcloud/webpack-vue-config')
const path = require('path')
const webpack = require('webpack')
webpackConfig.output.filename = 'nextcloud-register-main.js'
webpackConfig.output.path = path.join(__dirname, '../dist/signup/js/')
webpackConfig.devServer = {
static: [
{
directory: path.join(__dirname, 'public'),
},
{
directory: path.join(__dirname, '../dist/signup/js/'),
publicPath: '/js',
}
],
compress: true,
port: 9000,
}
if (process.env.NODE_ENV === 'production') {
webpackConfig.mode = 'production'
webpackConfig.plugins.push(new webpack.DefinePlugin({ providersUrl: JSON.stringify('/wp-json/signup/providers') }))
} else {
webpackConfig.mode = 'development'
// For testing purposes
webpackConfig.plugins.push(new webpack.DefinePlugin({ providersUrl: JSON.stringify('/preferred.json') }))
}
module.exports = webpackConfig