mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-01-09 21:46:56 -06:00
PR-579798: trying to fix Cypress component testing.
This commit is contained in:
parent
bac407a59b
commit
dbaa73eb08
@ -12,8 +12,6 @@ import CopyPlugin from 'copy-webpack-plugin';
|
|||||||
import { resolveTsAliases } from 'resolve-ts-aliases';
|
import { resolveTsAliases } from 'resolve-ts-aliases';
|
||||||
|
|
||||||
const dotEnvToParse = dotenv.config();
|
const dotEnvToParse = dotenv.config();
|
||||||
const externalCss = process.env.EXTERNAL_CSS === 'true' ? true : false;
|
|
||||||
const externalCssName = process.env.EXTERNAL_CSS_NAME ? process.env.EXTERNAL_CSS_NAME : 'index.css';
|
|
||||||
const alias = resolveTsAliases(path.resolve('tsconfig.json'));
|
const alias = resolveTsAliases(path.resolve('tsconfig.json'));
|
||||||
const copyPatterns: {from: string, to: string}[] = [];
|
const copyPatterns: {from: string, to: string}[] = [];
|
||||||
|
|
||||||
@ -39,11 +37,9 @@ export default {
|
|||||||
target: 'web',
|
target: 'web',
|
||||||
plugins: [
|
plugins: [
|
||||||
new CleanWebpackPlugin(),
|
new CleanWebpackPlugin(),
|
||||||
...(externalCss === true ? [
|
new MiniCssExtractPlugin({
|
||||||
new MiniCssExtractPlugin({
|
filename: 'index.css',
|
||||||
filename: externalCssName,
|
}),
|
||||||
}),
|
|
||||||
] : []),
|
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': JSON.stringify(dotEnvToParse.parsed),
|
'process.env': JSON.stringify(dotEnvToParse.parsed),
|
||||||
}),
|
}),
|
||||||
@ -70,7 +66,7 @@ export default {
|
|||||||
{
|
{
|
||||||
test: /\.(css|sass|scss)$/,
|
test: /\.(css|sass|scss)$/,
|
||||||
use: [
|
use: [
|
||||||
externalCss === true ? MiniCssExtractPlugin.loader : 'style-loader',
|
MiniCssExtractPlugin.loader,
|
||||||
'css-loader',
|
'css-loader',
|
||||||
'sass-loader',
|
'sass-loader',
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user