Webpack CSS构建在生产模式下失败

时间:2020-10-30 06:01:56

标签: webpack sass sass-loader

我已经更新了Webpack构建,用dart-sass替换了node-sass。在进行这些更改之前,构建工作正常。

在开发模式下,构建成功完成,但是运行生产构建失败:

#!/usr/bin/perl
use strict;
use warnings;

my $filename = '/home/vkk/Scripts/outfile.txt';
open(my $fh, '>>', $filename) or die "Could not open file '$filename' $!";
print $fh "Write this line to file\n";
close $fh;
print "done\n";

这是JisonLexerError: Lexical error on line 1: Unrecognized text. Erroneous area: 1: 1.3em + 0.75rem2px ^...........^ 的转码输出,在开发人员模式下工作正常,但在生产模式下工作正常。

CSS规则如下所示(dev):

calc(1.3em + 0.75em + 2px)

只有产品版本上的差异为{ test: /\.(sc|c)ss$/, use: [ { loader: MiniCssExtractPlugin.loader, options: { hmr: true } }, 'css-loader', 'sass-loader' ] }, ,但失败。我需要了解生产与开发之间的哪些区别?

0 个答案:

没有答案