Почему-то ругаеться laravel на webpack грубо говоря, пишет, что невозможно выполнить файл так как в нем присутствует объект
window
использую
https://github.com/spatie/laravel-server-side-rendering
вот конфиг webpack:
const CleanWebpackPlugin = require("clean-webpack-plugin"); //installed via npm
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const uniqid = require("uniqid");
let mix = require("laravel-mix");
let webpack = require("webpack");
let CompressionPlugin = require("compression-webpack-plugin");
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix
.react("resources/assets/js/app.js", "public/js")
.react("resources/assets/js/app-server.js", "public/js")
.sass("resources/assets/sass/app.scss", "public/css")
.version();
let plugins = [new CleanWebpackPlugin(["public/js/*"])];
if (process.env.NODE_ENV === "production") {
plugins.push(
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: false,
ecma: 6,
mangle: true
},
sourceMap: true
})
);
plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
plugins.push(
new CompressionPlugin({
asset: "[path].gz[query]",
algorithm: "gzip",
test: /\.js$|\.html$/,
threshold: 10240,
minRatio: 0.8
})
);
}
mix.webpackConfig({
output: {
// filename: "js/app.js",
chunkFilename: "js/[name]." + uniqid() + ".bundle.js",
pathinfo: true
},
plugins: plugins
});