Skip to content

Commit f7266d8

Browse files
authored
Merge pull request #3644 from nextcloud/fix(webpack)-revert-output-file-name
Revert webpack output file name
2 parents 04ae56d + cffec25 commit f7266d8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

webpack.config.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const webpackRules = require('@nextcloud/webpack-vue-config/rules')
44
const glob = require('glob')
55
const md5 = require('md5')
66
const path = require('path')
7-
const { loadTranslations } = require('./resources/translations.js')
87

98
const { DefinePlugin } = require('webpack')
109
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
@@ -14,6 +13,7 @@ const buildMode = process.env.NODE_ENV
1413
const isDev = buildMode === 'development'
1514
const libraryTarget = process.env.LIBRARY_TARGET ?? 'umd'
1615

16+
const { loadTranslations } = require('./resources/translations.js')
1717
const { dependencies } = require('./package.json')
1818

1919
// scope variable
@@ -25,29 +25,33 @@ const SCOPE_VERSION = JSON.stringify(versionHash)
2525
console.info('This build version hash is', versionHash, '\n')
2626

2727
webpackConfig.entry = {
28-
index: path.join(__dirname, 'src', 'index.js'),
28+
install: path.join(__dirname, 'src', 'install.js'),
2929
ncvuecomponents: path.join(__dirname, 'src', 'index.js'),
30+
3031
...glob.sync('src/components/*/index.js').reduce((acc, item) => {
3132
const name = item
3233
.replace('/index.js', '')
3334
.replace('src/components/', 'Components/')
3435
acc[name] = path.join(__dirname, item)
3536
return acc
3637
}, {}),
38+
3739
...glob.sync('src/directives/*/index.js').reduce((acc, item) => {
3840
const name = item
3941
.replace('/index.js', '')
4042
.replace('src/directives/', 'Directives/')
4143
acc[name] = path.join(__dirname, item)
4244
return acc
4345
}, {}),
46+
4447
...glob.sync('src/functions/*/index.js').reduce((acc, item) => {
4548
const name = item
4649
.replace('/index.js', '')
4750
.replace('src/functions/', 'Functions/')
4851
acc[name] = path.join(__dirname, item)
4952
return acc
5053
}, {}),
54+
5155
...glob.sync('src/mixins/*/index.js').reduce((acc, item) => {
5256
const name = item
5357
.replace('/index.js', '')
@@ -57,11 +61,11 @@ webpackConfig.entry = {
5761
}, {}),
5862
}
5963

64+
webpackConfig.devtool = isDev ? false : 'source-map'
6065
webpackConfig.output = {
6166
path: path.resolve(__dirname, './dist'),
6267
publicPath: '/dist/',
63-
filename: `[name].${libraryTarget}.js`,
64-
libraryTarget: 'umd',
68+
filename: '[name].js',
6569
library: {
6670
type: libraryTarget,
6771
name: ['NextcloudVue', '[name]'],
@@ -117,15 +121,15 @@ module.exports = async () => {
117121
outputModule: true,
118122
}
119123

124+
webpackConfig.entry = {
125+
index: path.join(__dirname, 'src', 'index.js'),
126+
}
120127
webpackConfig.output.filename = `[name].${libraryTarget}.js`
121128

122129
webpackConfig.externals = [...webpackConfig.externals, ...Object.keys(dependencies)]
123130

124131
delete webpackConfig.output.library.name
125132
}
126133

127-
// Do not minimize
128-
webpackConfig.optimization.minimize = false
129-
130134
return webpackConfig
131135
}

0 commit comments

Comments
 (0)