mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 17:27:09 +00:00
Two workers & worker termination (#198)
* Refactoring codecs * Plugging in new processor * Fixing decorator * MozJPEG free issue * Better worker aborting, and terminate workers that aren't used for 10 seconds * Better comment * Ooops, half-typed comment * Uncommenting problematic line * Surma fixed it! * Abstracting WASM initialisation * Better comment * Don't need this. * Adding ticket * noInitalRun * Reverting MozJPEG issue demo * Making a const for worker timeout * Inline docs * Bail early rather than nesting * Addressing nits
This commit is contained in:
@@ -12,6 +12,7 @@ const ReplacePlugin = require('webpack-plugin-replace');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const WatchTimestampsPlugin = require('./config/watch-timestamps-plugin');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const WorkerPlugin = require('worker-plugin');
|
||||
|
||||
function readJson (filename) {
|
||||
return JSON.parse(fs.readFileSync(filename));
|
||||
@@ -130,10 +131,6 @@ module.exports = function (_, env) {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.worker.[tj]sx?$/,
|
||||
loader: 'comlink-loader'
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: nodeModules,
|
||||
@@ -183,6 +180,8 @@ module.exports = function (_, env) {
|
||||
beforeEmit: true
|
||||
}),
|
||||
|
||||
new WorkerPlugin(),
|
||||
|
||||
// Automatically split code into async chunks.
|
||||
// See: https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
|
||||
isProd && new webpack.optimize.SplitChunksPlugin({}),
|
||||
|
||||
Reference in New Issue
Block a user