When I start webpack
, it compiles my scss
files and convert small files to base64
. However, it also copies large images from my /img
folder into the output folder. How can I prevent webpack
doing this? I want that webpack
left references to my original images in the image folder and not copy them into the output folder.
webpack
creates files that looks like this (in the output folder):
5474fbe2d9c2987bc9345fb6cf66fd25.png
Here is my webpack config file:
module.exports = {
context: path.join(__dirname, "/www"),
entry: [
"./src/base/style.scss",
],
output: {
filename: "bundle.css",
path: path.join(__dirname, "/www/dist")
},
devtool: "source-map",
resolve: {
extensions: ["", ".scss"]
},
module: {
loaders: [
{
test: /\.(scss|sass)$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader', 'sass-loader', 'postcss-loader', 'raw-loader'),
exclude: /node_modules/
},
{
test: /\.(png|jpeg|jpg|gif|...)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=2000'
}
],
preLoaders: [
{ test: /\.(scss)$/, loader: "source-map-loader" }
]
},
postcss: function () {
return [autoprefixer, precss];
},
sassLoader: {
includePaths: [path.join(__dirname, 'www/src')]
},
plugins: [
new webpack.optimize.DedupePlugin(),
new ExtractTextPlugin('bundle.css')
]
}