diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-06-16 09:44:35 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-07-14 15:54:43 +0300 |
commit | 86b446f8490707cb58c1b4d879e24dd7d9e66212 (patch) | |
tree | 92458e325d34b83226bd073ed1c75ca38b59d357 /webpack.js | |
parent | c6b34c47c8d389268d01e6c62b6a81f913e74c98 (diff) |
Move to shared babel/webpack config
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'webpack.js')
-rw-r--r-- | webpack.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/webpack.js b/webpack.js new file mode 100644 index 000000000..c4ccd2252 --- /dev/null +++ b/webpack.js @@ -0,0 +1,29 @@ +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 = '[name].js?v=[contenthash]' +webpackConfig.optimization.splitChunks.chunks = 'all' +Object.assign(webpackConfig.optimization.splitChunks, { + cacheGroups: { + highlight: { + enforce: true, + test: /[\\/]node_modules[\\/](hightlight\.js)[\\/]/, + }, + vendors: { + test: /[\\/]node_modules[\\/]/, + reuseExistingChunk: true + } + } +}) + +console.log(webpackConfig) + +module.exports = webpackConfig |