Revize 5ba222b9
Přidáno uživatelem Tomáš před více než 3 roky(ů)
website/webpack.config.js | ||
---|---|---|
1 | 1 |
const path = require('path'); |
2 |
module.exports = { |
|
2 |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
|
3 |
|
|
4 |
module.exports = [{ |
|
3 | 5 |
entry: { |
4 | 6 |
index: "./public/js/index.js", |
5 | 7 |
polyfills: './public/js/polyfills.js', |
... | ... | |
12 | 14 |
path: path.resolve(__dirname, 'public/js'), |
13 | 15 |
library: 'js' |
14 | 16 |
}, |
15 |
} |
|
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 |
] |
Také k dispozici: Unified diff
done