diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2021-06-30 00:14:27 +0200 |
---|---|---|
committer | Kristóf Marussy <marussy@mit.bme.hu> | 2021-06-30 00:14:27 +0200 |
commit | a98365fce92c621f1725d591dbec665b6060157f (patch) | |
tree | d5442766a0f2b043202ba5ec20a84b1caf1e106e /language-web/webpack.config.js | |
parent | Pin all m2 dependency versions (diff) | |
download | refinery-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.js | 5 |
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 | ||
4 | const WebpackBeforeBuildPlugin = require('before-build-webpack'); | 4 | const WebpackBeforeBuildPlugin = require('before-build-webpack'); |
5 | const HtmlWebpackPlugin = require('html-webpack-plugin'); | 5 | const HtmlWebpackPlugin = require('html-webpack-plugin'); |
6 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | 6 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
7 | const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); | ||
7 | 8 | ||
8 | const currentNodeEnv = process.env.NODE_ENV || 'development'; | 9 | const currentNodeEnv = process.env.NODE_ENV || 'development'; |
9 | const devMode = currentNodeEnv !== 'production'; | 10 | const 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 : { |