aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/webpack.config.js
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <marussy@mit.bme.hu>2021-06-30 00:14:27 +0200
committerLibravatar Kristóf Marussy <marussy@mit.bme.hu>2021-06-30 00:14:27 +0200
commita98365fce92c621f1725d591dbec665b6060157f (patch)
treed5442766a0f2b043202ba5ec20a84b1caf1e106e /language-web/webpack.config.js
parentPin all m2 dependency versions (diff)
downloadrefinery-a98365fce92c621f1725d591dbec665b6060157f.tar.gz
refinery-a98365fce92c621f1725d591dbec665b6060157f.tar.zst
refinery-a98365fce92c621f1725d591dbec665b6060157f.zip
Webpack subresource integrity
Diffstat (limited to 'language-web/webpack.config.js')
-rw-r--r--language-web/webpack.config.js5
1 files changed, 4 insertions, 1 deletions
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');
3 3
4const WebpackBeforeBuildPlugin = require('before-build-webpack'); 4const WebpackBeforeBuildPlugin = require('before-build-webpack');
5const HtmlWebpackPlugin = require('html-webpack-plugin'); 5const HtmlWebpackPlugin = require('html-webpack-plugin');
6const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 6const MiniCssExtractPlugin = require('mini-css-extract-plugin');
7const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity');
7 8
8const currentNodeEnv = process.env.NODE_ENV || 'development'; 9const currentNodeEnv = process.env.NODE_ENV || 'development';
9const devMode = currentNodeEnv !== 'production'; 10const devMode = currentNodeEnv !== 'production';
@@ -28,6 +29,7 @@ module.exports = {
28 publicPath: '/', 29 publicPath: '/',
29 filename: devMode ? '[name].js' : '[contenthash].js', 30 filename: devMode ? '[name].js' : '[contenthash].js',
30 chunkFilename: devMode ? '[id].js' : '[contenthash].js', 31 chunkFilename: devMode ? '[id].js' : '[contenthash].js',
32 crossOriginLoading: 'anonymous',
31 }, 33 },
32 module: { 34 module: {
33 rules: [ 35 rules: [
@@ -103,6 +105,7 @@ module.exports = {
103 filename: '[contenthash].css', 105 filename: '[contenthash].css',
104 chunkFilename: '[contenthash].css', 106 chunkFilename: '[contenthash].css',
105 }), 107 }),
108 new SubresourceIntegrityPlugin(),
106 new HtmlWebpackPlugin({ 109 new HtmlWebpackPlugin({
107 template: 'src/main/html/index.html', 110 template: 'src/main/html/index.html',
108 minify: devMode ? false : { 111 minify: devMode ? false : {