Welcome to mirror list, hosted at ThFree Co, Russian Federation.

webpack.js - github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0195ed04a78bdddb3df57c7d6a4d2396a50a5a66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const path = require('path')
const webpack = require('webpack')
const webpackConfig = require('@nextcloud/webpack-vue-config')

webpackConfig.entry = {
	text: path.join(__dirname, 'src', 'main.js'),
	files: path.join(__dirname, 'src', 'files.js'),
	public: path.join(__dirname, 'src', 'public.js'),
	viewer: path.join(__dirname, 'src', 'viewer.js'),
}

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

webpackConfig.optimization.chunkIds = 'named'
webpackConfig.optimization.splitChunks.cacheGroups = {
	defaultVendors: {
		test(module) {
			return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}`) &&
				!module.resource.includes(`${path.sep}highlight.js${path.sep}`)
		},
		name: 'vendors',
	}
}

webpackConfig.resolve.modules = [
	path.resolve(__dirname, 'node_modules'),
	'node_modules'
]

module.exports = webpackConfig