aswi2020sebela-gitlab/website/webpack.config.js @ 5ba222b9
1 |
const path = require('path'); |
---|---|
2 |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
3 |
|
4 |
module.exports = [{ |
5 |
entry: { |
6 |
index: "./public/js/index.js", |
7 |
polyfills: './public/js/polyfills.js', |
8 |
},
|
9 |
optimization: { |
10 |
minimize: true |
11 |
},
|
12 |
output: { |
13 |
filename: '[name].bundle.js', |
14 |
path: path.resolve(__dirname, 'public/js'), |
15 |
library: 'js' |
16 |
},
|
17 |
}, { |
18 |
plugins: [new MiniCssExtractPlugin()], |
19 |
entry: { |
20 |
style: ['./public/css/style.scss'] |
21 |
},
|
22 |
optimization: { |
23 |
minimize: true |
24 |
},
|
25 |
output: { |
26 |
filename: '[name].[hash:8].css', |
27 |
publicPath: '', |
28 |
path: path.resolve(__dirname, 'public/css'), |
29 |
sourceMapFilename: '[id].[hash:8].map', |
30 |
chunkFilename: '[id].[hash:8].css' |
31 |
},
|
32 |
module: { |
33 |
rules: [ |
34 |
{
|
35 |
test: /\.scss$/, |
36 |
use: [ |
37 |
{ loader: 'style-loader' }, |
38 |
{ loader: MiniCssExtractPlugin.loader }, |
39 |
{ loader: 'css-loader' }, |
40 |
{
|
41 |
loader: 'postcss-loader', |
42 |
options: { |
43 |
postcssOptions: { |
44 |
plugins: [ |
45 |
[
|
46 |
"autoprefixer" |
47 |
],
|
48 |
],
|
49 |
},
|
50 |
},
|
51 |
},
|
52 |
{
|
53 |
loader: 'sass-loader' |
54 |
}
|
55 |
]
|
56 |
},
|
57 |
{
|
58 |
test: /\.(png|jp(e*)g|svg)(\?v=\d+\.\d+\.\d+)?$/, |
59 |
use: [ |
60 |
{
|
61 |
loader: 'file-loader', |
62 |
options: { |
63 |
name: '[name].[ext]', |
64 |
outputPath: 'img/' |
65 |
}
|
66 |
}
|
67 |
]
|
68 |
},
|
69 |
]
|
70 |
}
|
71 |
}
|
72 |
]
|
- « Předchozí
- 1
- …
- 11
- 12
- 13
- Další »