Skip to content
Snippets Groups Projects
Commit d8b3f5fb authored by Akihiko Odaki's avatar Akihiko Odaki Committed by Eugen Rochko
Browse files

Limit environment variables to expose to webpack (#7480)

parent d75b63e4
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,10 @@ const output = {
module.exports = {
settings,
themes,
env,
env: {
CDN_HOST: env.CDN_HOST,
NODE_ENV: env.NODE_ENV,
},
loadersDir,
output,
};
......@@ -6,7 +6,7 @@ const CompressionPlugin = require('compression-webpack-plugin');
const sharedConfig = require('./shared.js');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const OfflinePlugin = require('offline-plugin');
const { publicPath } = require('./configuration.js');
const { env, publicPath } = require('./configuration.js');
const path = require('path');
let compressionAlgorithm;
......@@ -90,7 +90,7 @@ module.exports = merge(sharedConfig, {
'**/*.woff',
],
ServiceWorker: {
entry: `imports-loader?process.env=>${encodeURIComponent(JSON.stringify(process.env))}!${encodeURI(path.join(__dirname, '../../app/javascript/mastodon/service_worker/entry.js'))}`,
entry: `imports-loader?process.env=>${encodeURIComponent(JSON.stringify(env))}!${encodeURI(path.join(__dirname, '../../app/javascript/mastodon/service_worker/entry.js'))}`,
cacheName: 'mastodon',
output: '../assets/sw.js',
publicPath: '/sw.js',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment