Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

fix: webpack server config will omit image output #205

Merged
merged 1 commit into from
May 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions webpack_config/client/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ const baseBuild = {
{
test: /\.(ico|eot|otf|webp|ttf|woff|woff2)$/i,
use: `file-loader?limit=100000&name=assets/[name].[hash:6].[ext]`
},
{
test: /\.(jpe?g|png|gif|svg)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 4096,
name: 'images/[name].[hash:6].[ext]'
}
}
]
}
])
},
Expand Down
16 changes: 15 additions & 1 deletion webpack_config/server/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,21 @@ const baseWebpackConfig = {
alias: isomorphicWebpackConfig.resolve.alias
},
module: {
rules: isomorphicWebpackConfig.module.rules
rules: isomorphicWebpackConfig.module.rules.concat(
{
test: /\.(jpe?g|png|gif|svg)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 4096,
name: 'images/[name].[hash:6].[ext]',
emitFile: false
}
}
]
}
)
},
plugins: isomorphicWebpackConfig.plugins.concat([
new webpack.DefinePlugin(definePluginArgs),
Expand Down
12 changes: 0 additions & 12 deletions webpack_config/webpack.isomorphic.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@ export default {
test: /\.(js|jsx)$/,
use: 'babel-loader',
exclude: [/node_modules/]
},
{
test: /\.(jpe?g|png|gif|svg)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 4096,
name: 'images/[name].[hash:6].[ext]'
}
}
]
}
]
},
Expand Down