|
|
@ -4,6 +4,7 @@ const MediaQueryPlugin = require('media-query-plugin'); |
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
|
|
|
const postcssPresetEnv = require('postcss-preset-env'); |
|
|
|
const postcssPresetEnv = require('postcss-preset-env'); |
|
|
|
const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin'); |
|
|
|
const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin'); |
|
|
|
|
|
|
|
const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin'); |
|
|
|
const fs = require('fs'); |
|
|
|
const fs = require('fs'); |
|
|
|
|
|
|
|
|
|
|
|
const allowedIPs = ['127.0.0.1']; |
|
|
|
const allowedIPs = ['127.0.0.1']; |
|
|
@ -143,7 +144,21 @@ module.exports = { |
|
|
|
new ServiceWorkerWebpackPlugin({ |
|
|
|
new ServiceWorkerWebpackPlugin({ |
|
|
|
entry: path.join(__dirname, 'src/lib/mtproto/mtproto.service.ts'), |
|
|
|
entry: path.join(__dirname, 'src/lib/mtproto/mtproto.service.ts'), |
|
|
|
filename: 'sw.js', |
|
|
|
filename: 'sw.js', |
|
|
|
excludes: ['**/*'], |
|
|
|
//excludes: ['**/*'],
|
|
|
|
|
|
|
|
includes: [ |
|
|
|
|
|
|
|
'**/*.js', |
|
|
|
|
|
|
|
'**/*.css', |
|
|
|
|
|
|
|
'**/*.json', |
|
|
|
|
|
|
|
'**/*.wasm', |
|
|
|
|
|
|
|
'**/*.mp3', |
|
|
|
|
|
|
|
'**/*.svg', |
|
|
|
|
|
|
|
'**/*.tgs', |
|
|
|
|
|
|
|
'**/*.ico', |
|
|
|
|
|
|
|
'**/*.woff', |
|
|
|
|
|
|
|
'**/*.woff2', |
|
|
|
|
|
|
|
'**/*.ttf', |
|
|
|
|
|
|
|
'**/*.webmanifest' |
|
|
|
|
|
|
|
], |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
new HtmlWebpackPlugin({ |
|
|
|
new HtmlWebpackPlugin({ |
|
|
@ -183,5 +198,23 @@ module.exports = { |
|
|
|
'only screen and (min-width: 721px)': 'desktop', |
|
|
|
'only screen and (min-width: 721px)': 'desktop', |
|
|
|
} |
|
|
|
} |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new RetryChunkLoadPlugin({ |
|
|
|
|
|
|
|
// optional stringified function to get the cache busting query string appended to the script src
|
|
|
|
|
|
|
|
// if not set will default to appending the string `?cache-bust=true`
|
|
|
|
|
|
|
|
cacheBust: `function() {
|
|
|
|
|
|
|
|
return Date.now(); |
|
|
|
|
|
|
|
}`,
|
|
|
|
|
|
|
|
// optional value to set the amount of time in milliseconds before trying to load the chunk again. Default is 0
|
|
|
|
|
|
|
|
retryDelay: 3000, |
|
|
|
|
|
|
|
// optional value to set the maximum number of retries to load the chunk. Default is 1
|
|
|
|
|
|
|
|
maxRetries: 999999, |
|
|
|
|
|
|
|
// optional list of chunks to which retry script should be injected
|
|
|
|
|
|
|
|
// if not set will add retry script to all chunks that have webpack script loading
|
|
|
|
|
|
|
|
//chunks: ['chunkName'],
|
|
|
|
|
|
|
|
// optional code to be executed in the browser context if after all retries chunk is not loaded.
|
|
|
|
|
|
|
|
// if not set - nothing will happen and error will be returned to the chunk loader.
|
|
|
|
|
|
|
|
//lastResortScript: "window.location.href='/500.html';",
|
|
|
|
|
|
|
|
}), |
|
|
|
], |
|
|
|
], |
|
|
|
}; |
|
|
|
}; |
|
|
|