Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

Commit 4ef8f82

Browse files
Preserve subdirectories for images in webpack output #50
1 parent e96f13f commit 4ef8f82

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

build/app.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = merge({
3636
outputs: {
3737
css: { filename: 'css/[name].css' },
3838
font: { filename: 'fonts/[name].[ext]' },
39-
image: { filename: 'images/[name].[ext]' },
39+
image: { filename: 'images/[path][name].[ext]' },
4040
javascript: { filename: 'js/[name].js' }
4141
},
4242

build/rules/images.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
include: config.paths.images,
1010
loader: 'file-loader',
1111
options: {
12+
context: config.paths.images,
1213
publicPath: config.paths.relative,
1314
name: config.outputs.image.filename,
1415
emitFile: false

build/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ module.exports = {
9595
new ExtractTextPlugin(config.outputs.css),
9696
new CleanPlugin(config.paths.public, { root: config.paths.root }),
9797
new CopyPlugin([{
98+
context: config.paths.images,
9899
from: {
99100
glob: `${config.paths.images}/**/*`,
100101
flatten: true,

0 commit comments

Comments
 (0)