Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
[#393](https://github.com/nextcloud/cookbook/pull/393) @christianlupus
- Support for dateCreated and dateModified field of schema.org Recipe
[#377](https://github.com/nextcloud/cookbook/pull/366/) @seyfeb
- Bundle-Analyzer and Optimization
[#403](https://github.com/nextcloud/cookbook/pull/403) @thembeat

### Changed
- Switch of project ownership to neextcloud organization in GitHub
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@
"babel-loader": "^8.1.0",
"css-loader": "^3.5.2",
"file-loader": "^6.0.0",
"lodash-webpack-plugin": "^0.11.5",
"svg-inline-loader": "^0.8.2",
"url-loader": "^4.1.0",
"vue-loader": "^15.9.1",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.11",
"vue-template-loader": "^1.1.0",
"webpack": "^4.42.1",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^3.3.11",
"webpack-merge": "^4.2.2"
"webpack-merge": "^4.2.2",
"compression-webpack-plugin": "^6.1.1"
}
}
32 changes: 32 additions & 0 deletions webpack.build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
const merge = require('webpack-merge')
const common = require('./webpack.config.js')
const TerserPlugIn = require('terser-webpack-plugin')
const CompressionPlugin = require('compression-webpack-plugin')

module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
optimization: {
minimizer: [
new TerserPlugIn({
terserOptions:{
//sideEffects: false,
// All files have side effects, and none can be tree-shaken
// {
// "./src/file2.js"
// ]
// }
output:{
comments: false
}
},
sourceMap: true
})
],
},
plugins: [
new CompressionPlugin({
test: /\.js(\?.*)?$/i,
}),
],
performance: {
hints: "warning",
// Calculates sizes of gziped bundles.
assetFilter: function (assetFilename) {
return assetFilename.endsWith(".js.gz");
},
}
})
12 changes: 10 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
var LodashModuleReplacementPlugin = require('lodash-webpack-plugin')

module.exports = {

Expand Down Expand Up @@ -45,15 +46,22 @@ module.exports = {
},
},
{
test: /\.(eot|woff|woff2|ttf|svg)$/,
test: /\.(eot|woff|woff2|ttf)$/,
loaders: 'file-loader',
options: {
name: '[path][name].[ext]?[hash]'
},
},
{
test: /\.svg$/,
loader: 'svg-inline-loader'
},
],
},
plugins: [new VueLoaderPlugin()],
plugins: [
new VueLoaderPlugin(),
new LodashModuleReplacementPlugin
],
resolve: {
extensions: ['*', '.js', '.vue', '.json'],
modules: [
Expand Down
8 changes: 8 additions & 0 deletions webpack.devel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
const merge = require('webpack-merge')
const common = require('./webpack.config.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin

module.exports = merge(common, {
mode: 'development',
devtool: 'inline-cheap-source-map',
plugins: [
new BundleAnalyzerPlugin(
{
openAnalyzer: false,
}
)
],
})