Skip to content

Commit

Permalink
webpack: use hardcoded appname for now
Browse files Browse the repository at this point in the history
The app name `text` in appinfo
and the package name `@nextcloud/text in package.json differ.
webpack-vue-config reads the app name from package.json.
But for bundling we need the one from appinfo.
Can be removed after merge of
nextcloud-libraries/webpack-vue-config#338
or a successor.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed May 23, 2022
1 parent dd60fed commit 19bc8f4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ webpackConfig.entry = {

webpackConfig.output.chunkFilename = '[id].js?v=[contenthash]'

// The app name `text` in appinfo
// and the package name `@nextcloud/text in package.json differ.
// webpack-vue-config reads the app name from package.json.
// But for bundling we need the one from appinfo.
// Can be removed after merge of
// https://github.com/nextcloud/webpack-vue-config/pull/338

const appName = 'text'

Object.assign(webpackConfig.output, {
publicPath: path.join('/apps/', appName, '/js/'),
filename: `${appName}-[name].js?v=[contenthash]`,
devtoolNamespace: appName,
devtoolModuleFilenameTemplate(info) {
const rootDir = process.cwd()
const rel = path.relative(rootDir, info.absoluteResourcePath)
return `webpack:///${appName}/${rel}`
},
})

webpackConfig.optimization.chunkIds = 'named'
webpackConfig.optimization.splitChunks.cacheGroups = {
defaultVendors: {
Expand Down

0 comments on commit 19bc8f4

Please sign in to comment.