Tidied up build directory

This commit is contained in:
n1474335 2019-04-14 21:55:52 +01:00
parent 8d0fcf37c5
commit 7163a0802d
2 changed files with 24 additions and 7 deletions

View File

@ -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("</head>",
"<script type='application/ld+json'>" +
JSON.stringify(grunt.file.read("src/web/static/structuredData.json")) +
"</script>");
JSON.stringify(JSON.parse(grunt.file.read("src/web/static/structuredData.json"))) +
"</script></head>");
return grunt.template.process(content, srcpath);
} else {
return content;

View File

@ -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"
}
},
]