@@ -4,7 +4,6 @@ const webpackRules = require('@nextcloud/webpack-vue-config/rules')
4
4
const glob = require ( 'glob' )
5
5
const md5 = require ( 'md5' )
6
6
const path = require ( 'path' )
7
- const { loadTranslations } = require ( './resources/translations.js' )
8
7
9
8
const { DefinePlugin } = require ( 'webpack' )
10
9
const BabelLoaderExcludeNodeModulesExcept = require ( 'babel-loader-exclude-node-modules-except' )
@@ -14,6 +13,7 @@ const buildMode = process.env.NODE_ENV
14
13
const isDev = buildMode === 'development'
15
14
const libraryTarget = process . env . LIBRARY_TARGET ?? 'umd'
16
15
16
+ const { loadTranslations } = require ( './resources/translations.js' )
17
17
const { dependencies } = require ( './package.json' )
18
18
19
19
// scope variable
@@ -25,29 +25,33 @@ const SCOPE_VERSION = JSON.stringify(versionHash)
25
25
console . info ( 'This build version hash is' , versionHash , '\n' )
26
26
27
27
webpackConfig . entry = {
28
- index : path . join ( __dirname , 'src' , 'index .js' ) ,
28
+ install : path . join ( __dirname , 'src' , 'install .js' ) ,
29
29
ncvuecomponents : path . join ( __dirname , 'src' , 'index.js' ) ,
30
+
30
31
...glob . sync ( 'src/components/*/index.js' ) . reduce ( ( acc , item ) => {
31
32
const name = item
32
33
. replace ( '/index.js' , '' )
33
34
. replace ( 'src/components/' , 'Components/' )
34
35
acc [ name ] = path . join ( __dirname , item )
35
36
return acc
36
37
} , { } ) ,
38
+
37
39
...glob . sync ( 'src/directives/*/index.js' ) . reduce ( ( acc , item ) => {
38
40
const name = item
39
41
. replace ( '/index.js' , '' )
40
42
. replace ( 'src/directives/' , 'Directives/' )
41
43
acc [ name ] = path . join ( __dirname , item )
42
44
return acc
43
45
} , { } ) ,
46
+
44
47
...glob . sync ( 'src/functions/*/index.js' ) . reduce ( ( acc , item ) => {
45
48
const name = item
46
49
. replace ( '/index.js' , '' )
47
50
. replace ( 'src/functions/' , 'Functions/' )
48
51
acc [ name ] = path . join ( __dirname , item )
49
52
return acc
50
53
} , { } ) ,
54
+
51
55
...glob . sync ( 'src/mixins/*/index.js' ) . reduce ( ( acc , item ) => {
52
56
const name = item
53
57
. replace ( '/index.js' , '' )
@@ -57,11 +61,11 @@ webpackConfig.entry = {
57
61
} , { } ) ,
58
62
}
59
63
64
+ webpackConfig . devtool = isDev ? false : 'source-map'
60
65
webpackConfig . output = {
61
66
path : path . resolve ( __dirname , './dist' ) ,
62
67
publicPath : '/dist/' ,
63
- filename : `[name].${ libraryTarget } .js` ,
64
- libraryTarget : 'umd' ,
68
+ filename : '[name].js' ,
65
69
library : {
66
70
type : libraryTarget ,
67
71
name : [ 'NextcloudVue' , '[name]' ] ,
@@ -117,15 +121,15 @@ module.exports = async () => {
117
121
outputModule : true ,
118
122
}
119
123
124
+ webpackConfig . entry = {
125
+ index : path . join ( __dirname , 'src' , 'index.js' ) ,
126
+ }
120
127
webpackConfig . output . filename = `[name].${ libraryTarget } .js`
121
128
122
129
webpackConfig . externals = [ ...webpackConfig . externals , ...Object . keys ( dependencies ) ]
123
130
124
131
delete webpackConfig . output . library . name
125
132
}
126
133
127
- // Do not minimize
128
- webpackConfig . optimization . minimize = false
129
-
130
134
return webpackConfig
131
135
}
0 commit comments