diff options
Diffstat (limited to 'language-web/webpack.config.js')
-rw-r--r-- | language-web/webpack.config.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/language-web/webpack.config.js b/language-web/webpack.config.js index 1bd0edb2..c51d55d6 100644 --- a/language-web/webpack.config.js +++ b/language-web/webpack.config.js | |||
@@ -1,11 +1,14 @@ | |||
1 | const fs = require('fs'); | 1 | const fs = require('fs'); |
2 | const path = require('path'); | 2 | const path = require('path'); |
3 | 3 | ||
4 | const { DefinePlugin } = require('webpack'); | ||
4 | const HtmlWebpackPlugin = require('html-webpack-plugin'); | 5 | const HtmlWebpackPlugin = require('html-webpack-plugin'); |
5 | const HtmlWebpackInjectPreload = require('@principalstudio/html-webpack-inject-preload'); | 6 | const HtmlWebpackInjectPreload = require('@principalstudio/html-webpack-inject-preload'); |
6 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | 7 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
7 | const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); | 8 | const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); |
8 | 9 | ||
10 | const packageInfo = require('./package.json'); | ||
11 | |||
9 | const currentNodeEnv = process.env.NODE_ENV || 'development'; | 12 | const currentNodeEnv = process.env.NODE_ENV || 'development'; |
10 | const devMode = currentNodeEnv !== 'production'; | 13 | const devMode = currentNodeEnv !== 'production'; |
11 | const outputPath = path.resolve(__dirname, 'build/webpack', currentNodeEnv); | 14 | const outputPath = path.resolve(__dirname, 'build/webpack', currentNodeEnv); |
@@ -194,6 +197,11 @@ module.exports = { | |||
194 | }, | 197 | }, |
195 | }, | 198 | }, |
196 | plugins: [ | 199 | plugins: [ |
200 | new DefinePlugin({ | ||
201 | 'DEBUG': JSON.stringify(devMode), | ||
202 | 'PACKAGE_NAME': JSON.stringify(packageInfo.name), | ||
203 | 'PACKAGE_VERSION': JSON.stringify(packageInfo.version), | ||
204 | }), | ||
197 | new MiniCssExtractPlugin({ | 205 | new MiniCssExtractPlugin({ |
198 | filename: '[name].[contenthash].css', | 206 | filename: '[name].[contenthash].css', |
199 | chunkFilename: '[name].[contenthash].css', | 207 | chunkFilename: '[name].[contenthash].css', |