Skip to content

Commit 7163a08

Browse files
committed
Tidied up build directory
1 parent 8d0fcf3 commit 7163a08

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

Gruntfile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ module.exports = function (grunt) {
167167
}, moduleEntryPoints),
168168
output: {
169169
path: __dirname + "/build/prod",
170+
filename: chunkData => {
171+
return chunkData.chunk.name === "main" ? "assets/[name].js": "[name].js";
172+
},
170173
globalObject: "this"
171174
},
172175
resolve: {
@@ -294,8 +297,8 @@ module.exports = function (grunt) {
294297
// Add Structured Data for SEO
295298
content = content.replace("</head>",
296299
"<script type='application/ld+json'>" +
297-
JSON.stringify(grunt.file.read("src/web/static/structuredData.json")) +
298-
"</script>");
300+
JSON.stringify(JSON.parse(grunt.file.read("src/web/static/structuredData.json"))) +
301+
"</script></head>");
299302
return grunt.template.process(content, srcpath);
300303
} else {
301304
return content;

webpack.config.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = {
4848
"process.browser": "true"
4949
}),
5050
new MiniCssExtractPlugin({
51-
filename: "[name].css"
51+
filename: "assets/[name].css"
5252
}),
5353
],
5454
resolve: {
@@ -80,15 +80,25 @@ module.exports = {
8080
{
8181
test: /\.css$/,
8282
use: [
83-
MiniCssExtractPlugin.loader,
83+
{
84+
loader: MiniCssExtractPlugin.loader,
85+
options: {
86+
publicPath: "../"
87+
}
88+
},
8489
"css-loader",
8590
"postcss-loader",
8691
]
8792
},
8893
{
8994
test: /\.scss$/,
9095
use: [
91-
MiniCssExtractPlugin.loader,
96+
{
97+
loader: MiniCssExtractPlugin.loader,
98+
options: {
99+
publicPath: "../"
100+
}
101+
},
92102
"css-loader",
93103
"sass-loader",
94104
]
@@ -97,7 +107,9 @@ module.exports = {
97107
test: /\.(ico|eot|ttf|woff|woff2)$/,
98108
loader: "url-loader",
99109
options: {
100-
limit: 10000
110+
limit: 10000,
111+
name: "[hash].[ext]",
112+
outputPath: "assets"
101113
}
102114
},
103115
{
@@ -120,7 +132,9 @@ module.exports = {
120132
exclude: /web\/static/,
121133
loader: "url-loader",
122134
options: {
123-
limit: 10000
135+
limit: 10000,
136+
name: "[hash].[ext]",
137+
outputPath: "assets"
124138
}
125139
},
126140
]

0 commit comments

Comments
 (0)