chore(webpack): Move to shared code for entrypoints and use webpack serve public path

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-05-17 09:49:22 +02:00
committed by backportbot-nextcloud[bot]
parent 2fd8cab627
commit 4cebac2306
8 changed files with 28 additions and 22 deletions

View File

@@ -1,9 +1,9 @@
const webpackConfig = require('@nextcloud/webpack-vue-config')
const webpack = require('webpack')
const path = require('path')
const buildMode = process.env.NODE_ENV
const isDev = buildMode === 'development'
const isDevServer = process.env.WEBPACK_DEV_SERVER;
const isDevServer = process.env.WEBPACK_SERVE
webpackConfig.entry = {
...webpackConfig.entry,
@@ -16,6 +16,11 @@ webpackConfig.entry = {
if (isDevServer) {
webpackConfig.output.publicPath = 'http://127.0.0.1:3000/'
webpackConfig.plugins.push(
new webpack.DefinePlugin({
'process.env.WEBPACK_SERVE': true,
})
)
} else {
webpackConfig.stats = {
context: path.resolve(__dirname, 'src'),