forked from mariusbalcytis/extract-file-loader
/
webpack.config.js
35 lines (34 loc) · 875 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const ExtractFilePlugin = require('../Plugin');
const AssetsPlugin = require('assets-webpack-plugin');
const outputDir = __dirname + '/output';
module.exports = {
resolve: {
alias: {
'@root': __dirname
}
},
entry: {
image: __dirname + '/../index?q=@root/cat.png!'
},
output: {
path: outputDir,
filename: 'result.js',
},
plugins: [
new ExtractFilePlugin(),
new AssetsPlugin({filename: 'manifest.json', path: outputDir})
],
module: {
rules: [
{
enforce: 'pre',
test: /\.(gif|png|jpe?g|svg)$/i,
loader: 'image-webpack-loader'
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
loader: 'file-loader?name=[name].optimized.[ext]'
},
],
}
};