mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 01:37:26 +00:00
_headers & _redirects generation (#240)
* Generate `_headers` and `_redirects` by passing assets through ejs templates. * PR feedback * Excluding service worker stuff from prerender * Build SW in dev * Let's give this a try * lol * Is this how it works?
This commit is contained in:
committed by
Jake Archibald
parent
9b572f9541
commit
6994cc3d15
@@ -14,6 +14,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
|
||||
const WorkerPlugin = require('worker-plugin');
|
||||
const AutoSWPlugin = require('./config/auto-sw-plugin');
|
||||
const CrittersPlugin = require('critters-webpack-plugin');
|
||||
const AssetTemplatePlugin = require('./config/asset-template-plugin');
|
||||
|
||||
function readJson (filename) {
|
||||
return JSON.parse(fs.readFileSync(filename));
|
||||
@@ -238,8 +239,11 @@ module.exports = function (_, env) {
|
||||
compile: true
|
||||
}),
|
||||
|
||||
new AutoSWPlugin({
|
||||
version: VERSION
|
||||
new AutoSWPlugin({ version: VERSION }),
|
||||
|
||||
isProd && new AssetTemplatePlugin({
|
||||
template: path.join(__dirname, '_headers.ejs'),
|
||||
filename: '_headers',
|
||||
}),
|
||||
|
||||
new ScriptExtHtmlPlugin({
|
||||
|
||||
Reference in New Issue
Block a user