Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Fix errors arising from strict .mjs handling.

Jason Millere8e151a926ef
diff --git a/webpack.config.js b/webpack.config.js
index a75d0f35..018b4cb6 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -49,7 +49,38 @@ module.exports = function (_, env) {
}
},
module: {
+ // Disable the default JavaScript handling:
+ defaultRules: [],
rules: [
+ {
+ oneOf: [
+ {
+ test: /(\.mjs|\.esm\.js)$/i,
+ type: 'javascript/esm',
+ resolve: {},
+ parser: {
+ harmony: true,
+ amd: false,
+ commonjs: false,
+ system: false,
+ requireInclude: false,
+ requireEnsure: false,
+ requireContext: false,
+ browserify: false,
+ requireJs: false,
+ node: false
+ }
+ },
+ {
+ type: 'javascript/auto',
+ resolve: {},
+ parser: {
+ system: false,
+ requireJs: false
+ }
+ }
+ ]
+ },
{
test: /\.(scss|sass)$/,
loader: 'sass-loader',