chore(webpack): Add npm run serve command

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-05-17 09:27:39 +02:00
parent 2a5eece8fd
commit 9f753e4395
3 changed files with 20 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ const path = require('path')
const buildMode = process.env.NODE_ENV
const isDev = buildMode === 'development'
const isDevServer = process.env.WEBPACK_DEV_SERVER;
webpackConfig.entry = {
...webpackConfig.entry,
@@ -13,14 +14,17 @@ webpackConfig.entry = {
reference: path.join(__dirname, 'src', 'init-reference.js'),
}
webpackConfig.stats = {
context: path.resolve(__dirname, 'src'),
assets: true,
entrypoints: true,
chunks: true,
modules: true,
if (isDevServer) {
webpackConfig.output.publicPath = 'http://127.0.0.1:3000/'
} else {
webpackConfig.stats = {
context: path.resolve(__dirname, 'src'),
assets: true,
entrypoints: true,
chunks: true,
modules: true,
}
}
// Workaround for https://github.com/nextcloud/webpack-vue-config/pull/432 causing problems with nextcloud-vue-collections
webpackConfig.resolve.alias = {}