From a98365fce92c621f1725d591dbec665b6060157f Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Wed, 30 Jun 2021 00:14:27 +0200 Subject: Webpack subresource integrity --- language-web/webpack.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'language-web/webpack.config.js') diff --git a/language-web/webpack.config.js b/language-web/webpack.config.js index f047f6c6..385c1024 100644 --- a/language-web/webpack.config.js +++ b/language-web/webpack.config.js @@ -3,7 +3,8 @@ const path = require('path'); const WebpackBeforeBuildPlugin = require('before-build-webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); const currentNodeEnv = process.env.NODE_ENV || 'development'; const devMode = currentNodeEnv !== 'production'; @@ -28,6 +29,7 @@ module.exports = { publicPath: '/', filename: devMode ? '[name].js' : '[contenthash].js', chunkFilename: devMode ? '[id].js' : '[contenthash].js', + crossOriginLoading: 'anonymous', }, module: { rules: [ @@ -103,6 +105,7 @@ module.exports = { filename: '[contenthash].css', chunkFilename: '[contenthash].css', }), + new SubresourceIntegrityPlugin(), new HtmlWebpackPlugin({ template: 'src/main/html/index.html', minify: devMode ? false : { -- cgit v1.2.3-54-g00ecf