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 c30bf3c936
commit 24d4d86aa4
8 changed files with 28 additions and 22 deletions

View File

@@ -1,11 +1,11 @@
const webpackConfig = require('@nextcloud/webpack-vue-config')
const webpack = require('webpack')
const path = require('path')
const ESLintPlugin = require('eslint-webpack-plugin')
const StyleLintPlugin = require('stylelint-webpack-plugin')
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,
@@ -18,6 +18,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'),