diff --git a/Gruntfile.js b/Gruntfile.js index eb9f438e..48d47bcb 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -167,6 +167,9 @@ module.exports = function (grunt) { }, moduleEntryPoints), output: { path: __dirname + "/build/prod", + filename: chunkData => { + return chunkData.chunk.name === "main" ? "assets/[name].js": "[name].js"; + }, globalObject: "this" }, resolve: { @@ -294,8 +297,8 @@ module.exports = function (grunt) { // Add Structured Data for SEO content = content.replace("", ""); + JSON.stringify(JSON.parse(grunt.file.read("src/web/static/structuredData.json"))) + + ""); return grunt.template.process(content, srcpath); } else { return content; diff --git a/webpack.config.js b/webpack.config.js index cfc74b75..effc70ba 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -48,7 +48,7 @@ module.exports = { "process.browser": "true" }), new MiniCssExtractPlugin({ - filename: "[name].css" + filename: "assets/[name].css" }), ], resolve: { @@ -80,7 +80,12 @@ module.exports = { { test: /\.css$/, use: [ - MiniCssExtractPlugin.loader, + { + loader: MiniCssExtractPlugin.loader, + options: { + publicPath: "../" + } + }, "css-loader", "postcss-loader", ] @@ -88,7 +93,12 @@ module.exports = { { test: /\.scss$/, use: [ - MiniCssExtractPlugin.loader, + { + loader: MiniCssExtractPlugin.loader, + options: { + publicPath: "../" + } + }, "css-loader", "sass-loader", ] @@ -97,7 +107,9 @@ module.exports = { test: /\.(ico|eot|ttf|woff|woff2)$/, loader: "url-loader", options: { - limit: 10000 + limit: 10000, + name: "[hash].[ext]", + outputPath: "assets" } }, { @@ -120,7 +132,9 @@ module.exports = { exclude: /web\/static/, loader: "url-loader", options: { - limit: 10000 + limit: 10000, + name: "[hash].[ext]", + outputPath: "assets" } }, ]