2022-08-11 02:38:23 +03:00
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
const { VanillaExtractPlugin } = require('@vanilla-extract/webpack-plugin')
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
2022-09-22 22:29:29 +03:00
|
|
|
const { DefinePlugin } = require('webpack')
|
|
|
|
|
|
|
|
const commitHash = require('child_process').execSync('git rev-parse HEAD')
|
2022-08-11 02:38:23 +03:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
babel: {
|
|
|
|
plugins: ['@vanilla-extract/babel-plugin'],
|
|
|
|
},
|
|
|
|
webpack: {
|
2022-09-22 22:29:29 +03:00
|
|
|
plugins: [
|
|
|
|
new VanillaExtractPlugin(),
|
|
|
|
new DefinePlugin({
|
|
|
|
'process.env.REACT_APP_GIT_COMMIT_HASH': JSON.stringify(commitHash.toString()),
|
|
|
|
}),
|
|
|
|
],
|
2022-08-11 02:38:23 +03:00
|
|
|
configure: (webpackConfig) => {
|
|
|
|
const instanceOfMiniCssExtractPlugin = webpackConfig.plugins.find(
|
|
|
|
(plugin) => plugin instanceof MiniCssExtractPlugin
|
|
|
|
)
|
|
|
|
if (instanceOfMiniCssExtractPlugin !== undefined) instanceOfMiniCssExtractPlugin.options.ignoreOrder = true
|
|
|
|
return webpackConfig
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|