Edit build for inline to avoid Safari unicode regex error

This commit is contained in:
d98762625 2018-11-23 10:35:38 +00:00
parent 20ea050728
commit 0a6d0d1352
4 changed files with 293 additions and 105 deletions

View file

@ -6,6 +6,7 @@ const NodeExternals = require("webpack-node-externals");
const Inliner = require("web-resource-inliner");
const glob = require("glob");
const path = require("path");
const UglifyJSWebpackPlugin = require("uglifyjs-webpack-plugin");
/**
* Grunt configuration for building the app in various formats.
@ -219,6 +220,24 @@ module.exports = function (grunt) {
filename: "scripts.js",
path: __dirname + "/build/prod"
},
optimization: {
minimizer: [
/**
* Override default uglifyJS plugin to escape
* unicode chars in string and literals, avoiding
* error with Safari.
*/
new UglifyJSWebpackPlugin({
cache: true,
parallel: true,
uglifyOptions: {
output: {
"ascii_only": true,
}
}
})
],
},
plugins: [
new webpack.DefinePlugin(Object.assign({}, BUILD_CONSTANTS, {
INLINE: "true"